@coffic/cosy-ui 0.8.17 → 0.8.18
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.
- package/dist/app.css +1 -1
- package/dist/index-vue.ts +2 -2
- package/dist/src-vue/iPhone/StatusBarContent.vue +121 -0
- package/dist/src-vue/iPhone/iPhoneWindow.vue +177 -190
- package/dist/src-vue/iPhone/index.ts +10 -14
- package/dist/src-vue/icons/IPhoneBatteryIcon.vue +7 -0
- package/dist/src-vue/icons/IPhoneSignalIcon.vue +6 -0
- package/dist/src-vue/icons/IPhoneWifiIcon.vue +6 -0
- package/dist/src-vue/icons/index.ts +3 -0
- package/dist/src-vue/mac-window/MacWindow.vue +138 -159
- package/dist/src-vue/mac-window/index.ts +0 -34
- package/package.json +1 -1
- package/dist/src-vue/iPhone/WeatherApp.vue +0 -143
- package/dist/src-vue/mac-window/Basic.vue +0 -9
- package/dist/src-vue/mac-window/CustomHeight.vue +0 -13
- package/dist/src-vue/mac-window/WithEvents.vue +0 -40
- package/dist/src-vue/mac-window/WithSidebar.vue +0 -31
- package/dist/src-vue/mac-window/WithTabs.vue +0 -26
- package/dist/src-vue/mac-window/WithToolbar.vue +0 -44
@@ -100,184 +100,163 @@ import AlertDialog from '../alert-dialog/AlertDialog.vue';
|
|
100
100
|
import { ref, defineComponent, type PropType } from 'vue';
|
101
101
|
|
102
102
|
export default defineComponent({
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
},
|
107
|
-
props: {
|
108
|
-
height: {
|
109
|
-
type: String,
|
110
|
-
default: 'h-96',
|
103
|
+
name: 'MacWindow',
|
104
|
+
components: {
|
105
|
+
AlertDialog,
|
111
106
|
},
|
112
|
-
|
113
|
-
|
114
|
-
|
107
|
+
props: {
|
108
|
+
height: {
|
109
|
+
type: String,
|
110
|
+
default: 'h-96',
|
111
|
+
},
|
112
|
+
title: {
|
113
|
+
type: String,
|
114
|
+
default: '',
|
115
|
+
},
|
116
|
+
withShadow: {
|
117
|
+
type: Boolean,
|
118
|
+
default: true,
|
119
|
+
},
|
120
|
+
tabs: {
|
121
|
+
type: Array as PropType<string[]>,
|
122
|
+
default: () => [],
|
123
|
+
},
|
124
|
+
defaultTab: {
|
125
|
+
type: String,
|
126
|
+
default: '',
|
127
|
+
},
|
128
|
+
onCloseWindow: {
|
129
|
+
type: Function,
|
130
|
+
default: null,
|
131
|
+
},
|
132
|
+
onMinimizeWindow: {
|
133
|
+
type: Function,
|
134
|
+
default: null,
|
135
|
+
},
|
136
|
+
onMaximizeWindow: {
|
137
|
+
type: Function,
|
138
|
+
default: null,
|
139
|
+
},
|
140
|
+
onTabClick: {
|
141
|
+
type: Function,
|
142
|
+
default: null,
|
143
|
+
},
|
115
144
|
},
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
tabs: {
|
121
|
-
type: Array as PropType<string[]>,
|
122
|
-
default: () => [],
|
123
|
-
},
|
124
|
-
defaultTab: {
|
125
|
-
type: String,
|
126
|
-
default: '',
|
127
|
-
},
|
128
|
-
onCloseWindow: {
|
129
|
-
type: Function,
|
130
|
-
default: null,
|
131
|
-
},
|
132
|
-
onMinimizeWindow: {
|
133
|
-
type: Function,
|
134
|
-
default: null,
|
135
|
-
},
|
136
|
-
onMaximizeWindow: {
|
137
|
-
type: Function,
|
138
|
-
default: null,
|
139
|
-
},
|
140
|
-
onTabClick: {
|
141
|
-
type: Function,
|
142
|
-
default: null,
|
143
|
-
},
|
144
|
-
},
|
145
|
-
setup(props) {
|
146
|
-
const showAlertDialog = ref(false);
|
147
|
-
const alertMessage = ref('');
|
148
|
-
const activeTab = ref(props.defaultTab);
|
145
|
+
setup(props) {
|
146
|
+
const showAlertDialog = ref(false);
|
147
|
+
const alertMessage = ref('');
|
148
|
+
const activeTab = ref(props.defaultTab);
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
150
|
+
// 如果没有设置默认标签或默认标签不在tabs中,则选择第一个标签
|
151
|
+
if (
|
152
|
+
(!activeTab.value || !props.tabs.includes(activeTab.value)) &&
|
153
|
+
props.tabs.length > 0
|
154
|
+
) {
|
155
|
+
activeTab.value = props.tabs[0] as string;
|
156
|
+
}
|
157
157
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
158
|
+
const handleCloseWindow = () => {
|
159
|
+
alertMessage.value = '关闭APP窗口(这是演示,不会真实操作)';
|
160
|
+
showAlertDialog.value = true;
|
161
|
+
if (props.onCloseWindow) {
|
162
|
+
props.onCloseWindow();
|
163
|
+
}
|
164
|
+
};
|
165
165
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
166
|
+
const handleMinimizeWindow = () => {
|
167
|
+
alertMessage.value = '最小化窗口(这是演示,不会真实操作)';
|
168
|
+
showAlertDialog.value = true;
|
169
|
+
if (props.onMinimizeWindow) {
|
170
|
+
props.onMinimizeWindow();
|
171
|
+
}
|
172
|
+
};
|
173
173
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
174
|
+
const handleMaximizeWindow = () => {
|
175
|
+
alertMessage.value = '最大化窗口(这是演示,不会真实操作)';
|
176
|
+
showAlertDialog.value = true;
|
177
|
+
if (props.onMaximizeWindow) {
|
178
|
+
props.onMaximizeWindow();
|
179
|
+
}
|
180
|
+
};
|
181
181
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
182
|
+
const handleTabClick = (tab: string) => {
|
183
|
+
activeTab.value = tab;
|
184
|
+
if (props.onTabClick) {
|
185
|
+
props.onTabClick(tab);
|
186
|
+
}
|
187
|
+
};
|
188
188
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
189
|
+
return {
|
190
|
+
showAlertDialog,
|
191
|
+
alertMessage,
|
192
|
+
activeTab,
|
193
|
+
handleCloseWindow,
|
194
|
+
handleMinimizeWindow,
|
195
|
+
handleMaximizeWindow,
|
196
|
+
handleTabClick,
|
197
|
+
};
|
198
|
+
},
|
199
199
|
});
|
200
200
|
</script>
|
201
201
|
|
202
202
|
<template>
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
>
|
207
|
-
<!-- 窗口控制按钮 -->
|
208
|
-
<div
|
209
|
-
class="cosy:absolute cosy:top-0 cosy:left-0 cosy:right-0 cosy:flex cosy:items-center cosy:h-12 cosy:px-4 cosy:bg-base-200 cosy:border-b cosy:border-base-300"
|
210
|
-
>
|
211
|
-
<div class="cosy:flex cosy:items-center cosy:space-x-2">
|
212
|
-
<div
|
213
|
-
class="cosy:w-3 cosy:h-3 cosy:rounded-full cosy:bg-error cosy:cursor-pointer hover:cosy:opacity-80 cosy:transition-opacity"
|
214
|
-
@click="handleCloseWindow"
|
215
|
-
/>
|
216
|
-
<div
|
217
|
-
class="cosy:w-3 cosy:h-3 cosy:rounded-full cosy:bg-warning cosy:cursor-pointer hover:cosy:opacity-80 cosy:transition-opacity"
|
218
|
-
@click="handleMinimizeWindow"
|
219
|
-
/>
|
203
|
+
<div class="cosy:flex cosy:max-w-5xl cosy:mx-auto cosy:bg-base-100 cosy:relative cosy:rounded-2xl cosy:overflow-hidden"
|
204
|
+
:class="[height, withShadow ? 'cosy:shadow-lg' : '']">
|
205
|
+
<!-- 窗口控制按钮 -->
|
220
206
|
<div
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
207
|
+
class="cosy:absolute cosy:top-0 cosy:left-0 cosy:right-0 cosy:flex cosy:items-center cosy:h-12 cosy:px-4 cosy:bg-base-200 cosy:border-b cosy:border-base-300">
|
208
|
+
<div class="cosy:flex cosy:items-center cosy:space-x-2">
|
209
|
+
<div class="cosy:w-3 cosy:h-3 cosy:rounded-full cosy:bg-error cosy:cursor-pointer hover:cosy:opacity-80 cosy:transition-opacity"
|
210
|
+
@click="handleCloseWindow" />
|
211
|
+
<div class="cosy:w-3 cosy:h-3 cosy:rounded-full cosy:bg-warning cosy:cursor-pointer hover:cosy:opacity-80 cosy:transition-opacity"
|
212
|
+
@click="handleMinimizeWindow" />
|
213
|
+
<div class="cosy:w-3 cosy:h-3 cosy:rounded-full cosy:bg-success cosy:cursor-pointer hover:cosy:opacity-80 cosy:transition-opacity"
|
214
|
+
@click="handleMaximizeWindow" />
|
215
|
+
</div>
|
216
|
+
<div class="cosy:ml-6 cosy:text-sm cosy:font-medium cosy:text-base-content">
|
217
|
+
{{ title }}
|
218
|
+
</div>
|
230
219
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
: 'cosy:text-base-content/70 hover:cosy:text-base-content',
|
245
|
-
]"
|
246
|
-
@click="handleTabClick(tab)"
|
247
|
-
>
|
248
|
-
{{ tab }}
|
249
|
-
</button>
|
250
|
-
</div>
|
251
|
-
</div>
|
220
|
+
<!-- 标签选择器 -->
|
221
|
+
<div v-if="tabs?.length" class="cosy:flex-1 cosy:flex cosy:justify-center">
|
222
|
+
<div class="cosy:inline-flex cosy:rounded-lg cosy:bg-base-300 cosy:p-1">
|
223
|
+
<button v-for="(tab, index) in tabs" :key="index" :class="[
|
224
|
+
'cosy:px-3 cosy:py-1 cosy:text-sm cosy:rounded-md cosy:transition-colors',
|
225
|
+
activeTab === tab
|
226
|
+
? 'cosy:bg-base-100 cosy:text-base-content cosy:shadow'
|
227
|
+
: 'cosy:text-base-content/70 hover:cosy:text-base-content',
|
228
|
+
]" @click="handleTabClick(tab)">
|
229
|
+
{{ tab }}
|
230
|
+
</button>
|
231
|
+
</div>
|
232
|
+
</div>
|
252
233
|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
234
|
+
<!-- 工具栏插槽 -->
|
235
|
+
<div class="cosy:ml-auto cosy:flex cosy:items-center cosy:space-x-2">
|
236
|
+
<slot name="toolbar"></slot>
|
237
|
+
</div>
|
238
|
+
</div>
|
258
239
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
240
|
+
<!-- 主要内容区域 -->
|
241
|
+
<div class="cosy:flex-1 cosy:flex cosy:flex-col cosy:pt-12 cosy:h-full">
|
242
|
+
<div class="cosy:flex cosy:flex-1 cosy:h-full cosy:overflow-hidden">
|
243
|
+
<!-- 左侧栏插槽 -->
|
244
|
+
<slot name="sidebar" />
|
264
245
|
|
265
|
-
|
266
|
-
|
267
|
-
|
246
|
+
<!-- 主内容插槽 -->
|
247
|
+
<slot />
|
248
|
+
</div>
|
268
249
|
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
250
|
+
<!-- 底部状态栏 -->
|
251
|
+
<div v-if="$slots.status"
|
252
|
+
class="cosy:h-6 cosy:bg-base-200/95 cosy:border-t cosy:border-base-300 cosy:flex cosy:items-center cosy:justify-end cosy:px-4 cosy:text-sm">
|
253
|
+
<div class="cosy:flex cosy:items-center cosy:space-x-2">
|
254
|
+
<slot name="status"></slot>
|
255
|
+
</div>
|
256
|
+
</div>
|
276
257
|
</div>
|
277
|
-
</div>
|
278
258
|
</div>
|
279
|
-
</div>
|
280
259
|
|
281
|
-
|
282
|
-
|
260
|
+
<!-- AlertDialog 组件 -->
|
261
|
+
<AlertDialog v-model="showAlertDialog" :message="alertMessage" />
|
283
262
|
</template>
|
@@ -1,36 +1,2 @@
|
|
1
|
-
import Basic from './Basic.vue';
|
2
|
-
import WithTabs from './WithTabs.vue';
|
3
|
-
import WithEvents from './WithEvents.vue';
|
4
|
-
import WithToolbar from './WithToolbar.vue';
|
5
|
-
import WithSidebar from './WithSidebar.vue';
|
6
|
-
import CustomHeight from './CustomHeight.vue';
|
7
|
-
import BasicSource from './Basic.vue?raw';
|
8
|
-
import WithTabsSource from './WithTabs.vue?raw';
|
9
|
-
import WithEventsSource from './WithEvents.vue?raw';
|
10
|
-
import WithToolbarSource from './WithToolbar.vue?raw';
|
11
|
-
import WithSidebarSource from './WithSidebar.vue?raw';
|
12
|
-
import CustomHeightSource from './CustomHeight.vue?raw';
|
13
|
-
import { extractSimpleExample } from '../../astro/src/utils/component';
|
14
|
-
|
15
1
|
// 导出主组件
|
16
2
|
export { default as MacWindow } from './MacWindow.vue';
|
17
|
-
|
18
|
-
// 将示例组件整合为一个对象导出
|
19
|
-
export const MacWindowExamples = {
|
20
|
-
Basic,
|
21
|
-
WithTabs,
|
22
|
-
WithEvents,
|
23
|
-
WithToolbar,
|
24
|
-
WithSidebar,
|
25
|
-
CustomHeight,
|
26
|
-
};
|
27
|
-
|
28
|
-
// 导出示例组件的源代码(简化版本)
|
29
|
-
export const MacWindowExampleCodes = {
|
30
|
-
Basic: extractSimpleExample(BasicSource, 'MacWindow'),
|
31
|
-
WithTabs: extractSimpleExample(WithTabsSource, 'MacWindow'),
|
32
|
-
WithEvents: extractSimpleExample(WithEventsSource, 'MacWindow'),
|
33
|
-
WithToolbar: extractSimpleExample(WithToolbarSource, 'MacWindow'),
|
34
|
-
WithSidebar: extractSimpleExample(WithSidebarSource, 'MacWindow'),
|
35
|
-
CustomHeight: extractSimpleExample(CustomHeightSource, 'MacWindow'),
|
36
|
-
};
|
package/package.json
CHANGED
@@ -1,143 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow.WeatherApp
|
3
|
-
|
4
|
-
@description
|
5
|
-
天气应用示例,展示一个更复杂的 iPhone 应用界面,包含标题栏、主内容区和底部导航。
|
6
|
-
|
7
|
-
@usage
|
8
|
-
```vue
|
9
|
-
<iPhoneWindowExamples.WeatherApp />
|
10
|
-
```
|
11
|
-
-->
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import '../../app.css';
|
15
|
-
import { defineComponent } from 'vue';
|
16
|
-
import iPhoneWindow from './iPhoneWindow.vue';
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: 'iPhoneWindowWeatherAppExample',
|
20
|
-
components: {
|
21
|
-
iPhoneWindow,
|
22
|
-
},
|
23
|
-
});
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<iPhoneWindow>
|
28
|
-
<div class="cosy:flex cosy:flex-col cosy:h-full">
|
29
|
-
<!-- 应用标题栏 -->
|
30
|
-
<div
|
31
|
-
class="cosy:bg-primary cosy:text-white cosy:px-4 cosy:py-3 cosy:flex cosy:items-center cosy:justify-between"
|
32
|
-
>
|
33
|
-
<h2 class="cosy:font-medium">天气预报</h2>
|
34
|
-
<button class="cosy:btn cosy:btn-ghost cosy:btn-sm cosy:p-1">
|
35
|
-
<svg
|
36
|
-
xmlns="http://www.w3.org/2000/svg"
|
37
|
-
class="cosy:h-5 cosy:w-5"
|
38
|
-
viewBox="0 0 20 20"
|
39
|
-
fill="currentColor"
|
40
|
-
>
|
41
|
-
<path
|
42
|
-
fill-rule="evenodd"
|
43
|
-
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
44
|
-
clip-rule="evenodd"
|
45
|
-
/>
|
46
|
-
</svg>
|
47
|
-
</button>
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<!-- 主要内容 -->
|
51
|
-
<div
|
52
|
-
class="cosy:flex-1 cosy:p-4 cosy:bg-gradient-to-b cosy:from-blue-400 cosy:to-blue-600"
|
53
|
-
>
|
54
|
-
<div class="cosy:text-center cosy:text-white">
|
55
|
-
<div class="cosy:text-5xl cosy:font-light cosy:mb-2">23°</div>
|
56
|
-
<div class="cosy:text-xl cosy:mb-4">晴朗</div>
|
57
|
-
<div class="cosy:text-sm cosy:opacity-90">上海市,今天</div>
|
58
|
-
</div>
|
59
|
-
|
60
|
-
<div
|
61
|
-
class="cosy:mt-8 cosy:bg-white/20 cosy:backdrop-blur-sm cosy:rounded-xl cosy:p-4"
|
62
|
-
>
|
63
|
-
<div
|
64
|
-
class="cosy:grid cosy:grid-cols-3 cosy:gap-4 cosy:text-center cosy:text-white"
|
65
|
-
>
|
66
|
-
<div>
|
67
|
-
<div class="cosy:text-sm cosy:opacity-80">湿度</div>
|
68
|
-
<div class="cosy:font-medium">68%</div>
|
69
|
-
</div>
|
70
|
-
<div>
|
71
|
-
<div class="cosy:text-sm cosy:opacity-80">风速</div>
|
72
|
-
<div class="cosy:font-medium">8 km/h</div>
|
73
|
-
</div>
|
74
|
-
<div>
|
75
|
-
<div class="cosy:text-sm cosy:opacity-80">能见度</div>
|
76
|
-
<div class="cosy:font-medium">10 km</div>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
</div>
|
80
|
-
</div>
|
81
|
-
|
82
|
-
<!-- 底部导航 -->
|
83
|
-
<div
|
84
|
-
class="cosy:bg-white cosy:border-t cosy:border-gray-200 cosy:flex cosy:justify-around cosy:py-2"
|
85
|
-
>
|
86
|
-
<button class="cosy:p-2 cosy:text-primary">
|
87
|
-
<svg
|
88
|
-
xmlns="http://www.w3.org/2000/svg"
|
89
|
-
class="cosy:h-6 cosy:w-6"
|
90
|
-
fill="none"
|
91
|
-
viewBox="0 0 24 24"
|
92
|
-
stroke="currentColor"
|
93
|
-
>
|
94
|
-
<path
|
95
|
-
stroke-linecap="round"
|
96
|
-
stroke-linejoin="round"
|
97
|
-
stroke-width="2"
|
98
|
-
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
|
99
|
-
/>
|
100
|
-
</svg>
|
101
|
-
</button>
|
102
|
-
<button class="cosy:p-2">
|
103
|
-
<svg
|
104
|
-
xmlns="http://www.w3.org/2000/svg"
|
105
|
-
class="cosy:h-6 cosy:w-6"
|
106
|
-
fill="none"
|
107
|
-
viewBox="0 0 24 24"
|
108
|
-
stroke="currentColor"
|
109
|
-
>
|
110
|
-
<path
|
111
|
-
stroke-linecap="round"
|
112
|
-
stroke-linejoin="round"
|
113
|
-
stroke-width="2"
|
114
|
-
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
115
|
-
/>
|
116
|
-
</svg>
|
117
|
-
</button>
|
118
|
-
<button class="cosy:p-2">
|
119
|
-
<svg
|
120
|
-
xmlns="http://www.w3.org/2000/svg"
|
121
|
-
class="cosy:h-6 cosy:w-6"
|
122
|
-
fill="none"
|
123
|
-
viewBox="0 0 24 24"
|
124
|
-
stroke="currentColor"
|
125
|
-
>
|
126
|
-
<path
|
127
|
-
stroke-linecap="round"
|
128
|
-
stroke-linejoin="round"
|
129
|
-
stroke-width="2"
|
130
|
-
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
131
|
-
/>
|
132
|
-
<path
|
133
|
-
stroke-linecap="round"
|
134
|
-
stroke-linejoin="round"
|
135
|
-
stroke-width="2"
|
136
|
-
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
137
|
-
/>
|
138
|
-
</svg>
|
139
|
-
</button>
|
140
|
-
</div>
|
141
|
-
</div>
|
142
|
-
</iPhoneWindow>
|
143
|
-
</template>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<script setup>
|
2
|
-
import { MacWindow } from './index';
|
3
|
-
</script>
|
4
|
-
|
5
|
-
<template>
|
6
|
-
<MacWindow title="终端" height="cosy:h-64">
|
7
|
-
<div class="cosy:p-4 cosy:bg-gray-900 cosy:text-green-400 cosy:font-mono">
|
8
|
-
$ echo "Hello, World!"<br />
|
9
|
-
Hello, World!<br />
|
10
|
-
$ _
|
11
|
-
</div>
|
12
|
-
</MacWindow>
|
13
|
-
</template>
|
@@ -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>
|