@coffic/cosy-ui 0.8.17 → 0.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +0,0 @@
1
- <script setup>
2
- import { ref } from 'vue';
3
- import { MacWindow } from './index';
4
-
5
- const activeTab = ref('信息');
6
-
7
- const handleTabClick = (tab) => {
8
- activeTab.value = tab;
9
- console.log('切换到标签:', tab);
10
- };
11
-
12
- const handleClose = () => {
13
- alert('关闭窗口');
14
- };
15
-
16
- const handleMinimize = () => {
17
- alert('最小化窗口');
18
- };
19
-
20
- const handleMaximize = () => {
21
- alert('最大化窗口');
22
- };
23
- </script>
24
-
25
- <template>
26
- <MacWindow
27
- title="应用窗口"
28
- :tabs="['信息', '设置', '帮助']"
29
- :onTabClick="handleTabClick"
30
- :onCloseWindow="handleClose"
31
- :onMinimizeWindow="handleMinimize"
32
- :onMaximizeWindow="handleMaximize"
33
- >
34
- <div class="cosy:p-4">
35
- <div v-if="activeTab === '信息'">信息内容</div>
36
- <div v-if="activeTab === '设置'">设置内容</div>
37
- <div v-if="activeTab === '帮助'">帮助内容</div>
38
- </div>
39
- </MacWindow>
40
- </template>
@@ -1,31 +0,0 @@
1
- <script setup>
2
- import { MacWindow } from './index';
3
- </script>
4
-
5
- <template>
6
- <MacWindow title="文件浏览器">
7
- <template #sidebar>
8
- <div class="cosy:w-48 cosy:border-r cosy:border-base-300 cosy:p-2">
9
- <div class="cosy:font-medium cosy:mb-2">文件夹</div>
10
- <ul>
11
- <li
12
- class="cosy:py-1 cosy:px-2 hover:cosy:bg-base-200 cosy:rounded cosy:cursor-pointer"
13
- >
14
- 文档
15
- </li>
16
- <li
17
- class="cosy:py-1 cosy:px-2 hover:cosy:bg-base-200 cosy:rounded cosy:cursor-pointer"
18
- >
19
- 下载
20
- </li>
21
- <li
22
- class="cosy:py-1 cosy:px-2 hover:cosy:bg-base-200 cosy:rounded cosy:cursor-pointer"
23
- >
24
- 图片
25
- </li>
26
- </ul>
27
- </div>
28
- </template>
29
- <div class="cosy:p-4">主内容区域</div>
30
- </MacWindow>
31
- </template>
@@ -1,26 +0,0 @@
1
- <script setup>
2
- import { ref } from 'vue';
3
- import { MacWindow } from './index';
4
-
5
- const activeTab = ref('外观');
6
-
7
- const handleTabClick = (tab) => {
8
- activeTab.value = tab;
9
- console.log('当前标签:', tab);
10
- };
11
- </script>
12
-
13
- <template>
14
- <MacWindow
15
- title="设置"
16
- :tabs="['通用', '外观', '高级']"
17
- defaultTab="外观"
18
- :onTabClick="handleTabClick"
19
- >
20
- <div class="cosy:p-4">
21
- <div v-if="activeTab === '通用'">通用设置内容</div>
22
- <div v-if="activeTab === '外观'">外观设置内容</div>
23
- <div v-if="activeTab === '高级'">高级设置内容</div>
24
- </div>
25
- </MacWindow>
26
- </template>
@@ -1,44 +0,0 @@
1
- <script setup>
2
- import { MacWindow } from './index';
3
- import { SearchIcon, SettingsIcon, InfoIcon } from '../../index-vue';
4
-
5
- const handleSearch = () => {
6
- console.log('搜索');
7
- };
8
-
9
- const handleSettings = () => {
10
- console.log('设置');
11
- };
12
-
13
- const handleInfo = () => {
14
- console.log('信息');
15
- };
16
- </script>
17
-
18
- <template>
19
- <MacWindow title="文件浏览器">
20
- <!-- 工具栏插槽 -->
21
- <template #toolbar>
22
- <button class="cosy:btn cosy:btn-ghost cosy:btn-sm" @click="handleSearch">
23
- <SearchIcon class="cosy:w-4 cosy:h-4" />
24
- </button>
25
- <button
26
- class="cosy:btn cosy:btn-ghost cosy:btn-sm"
27
- @click="handleSettings"
28
- >
29
- <SettingsIcon class="cosy:w-4 cosy:h-4" />
30
- </button>
31
- </template>
32
-
33
- <!-- 主内容 -->
34
- <div class="cosy:p-4">窗口内容区域</div>
35
-
36
- <!-- 状态栏插槽 -->
37
- <template #status>
38
- <div class="cosy:text-xs">就绪</div>
39
- <button class="cosy:btn cosy:btn-ghost cosy:btn-xs" @click="handleInfo">
40
- <InfoIcon class="cosy:w-4 cosy:h-4" />
41
- </button>
42
- </template>
43
- </MacWindow>
44
- </template>