@coffic/cosy-ui 0.8.16 → 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 +14 -8
- package/dist/src-astro/header/Header.astro +1 -1
- package/dist/src-astro/icons/AstroIcon.astro +2 -3
- package/dist/src-astro/module/ModuleBasic.astro +1 -1
- package/dist/src-astro/module/ModuleCustom.astro +1 -1
- package/dist/src-astro/module/ModuleGrid.astro +3 -3
- package/dist/src-astro/sidebar-nav/SidebarNav.astro +3 -3
- package/dist/src-astro/speak/SpeakBasic.astro +1 -1
- package/dist/src-astro/speak/SpeakGrid.astro +3 -3
- package/dist/src-vue/SmartLink.vue +0 -1
- package/dist/src-vue/alert/Alert.vue +100 -0
- package/dist/src-vue/alert/index.ts +8 -0
- package/dist/src-vue/{alert-dialog-vue → alert-dialog}/index.ts +1 -1
- package/dist/src-vue/{banner-box-vue → banner-box}/index.ts +1 -1
- package/dist/src-vue/{blog-vue → blog}/BlogList.vue +2 -2
- package/dist/src-vue/{blog-vue → blog}/index.ts +1 -1
- package/dist/src-vue/{confirm-dialog-vue → confirm-dialog}/index.ts +1 -1
- package/dist/src-vue/container/Container.vue +214 -0
- package/dist/src-vue/container/index.ts +6 -0
- package/dist/src-vue/counter/index.ts +1 -0
- package/dist/src-vue/iPhone/StatusBarContent.vue +121 -0
- package/dist/src-vue/iPhone/iPhoneWindow.vue +234 -0
- package/dist/src-vue/{iPhone-vue → iPhone}/index.ts +10 -14
- package/dist/src-vue/icons/ErrorIcon.vue +30 -0
- 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/SuccessIcon.vue +30 -0
- package/dist/src-vue/icons/VueIcon.vue +13 -3
- package/dist/src-vue/icons/WarningIcon.vue +30 -0
- package/dist/src-vue/icons/index.ts +22 -1
- package/dist/src-vue/mac-window/MacWindow.vue +262 -0
- package/dist/src-vue/mac-window/index.ts +2 -0
- package/package.json +12 -2
- package/dist/src-vue/counter-vue/index.ts +0 -1
- package/dist/src-vue/iPhone-vue/WeatherApp.vue +0 -143
- package/dist/src-vue/iPhone-vue/iPhoneWindow.vue +0 -247
- package/dist/src-vue/mac-window-vue/Basic.vue +0 -9
- package/dist/src-vue/mac-window-vue/CustomHeight.vue +0 -13
- package/dist/src-vue/mac-window-vue/MacWindow.vue +0 -283
- package/dist/src-vue/mac-window-vue/WithEvents.vue +0 -40
- package/dist/src-vue/mac-window-vue/WithSidebar.vue +0 -31
- package/dist/src-vue/mac-window-vue/WithTabs.vue +0 -26
- package/dist/src-vue/mac-window-vue/WithToolbar.vue +0 -44
- package/dist/src-vue/mac-window-vue/index.ts +0 -36
- /package/dist/{src-astro → src}/assets/book.png +0 -0
- /package/dist/{src-astro → src}/assets/iconData.ts +0 -0
- /package/dist/{src-astro → src}/assets/logo-rounded.png +0 -0
- /package/dist/{src-astro → src}/assets/logo.png +0 -0
- /package/dist/src-vue/{alert-dialog-vue → alert-dialog}/AlertDialog.vue +0 -0
- /package/dist/src-vue/{alert-dialog-vue → alert-dialog}/Basic.vue +0 -0
- /package/dist/src-vue/{alert-dialog-vue → alert-dialog}/Multilang.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/BannerBox.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/DownloadButton.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleBasic.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleCustomBg.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleDisplayModeAlways.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleDisplayModeHover.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleDisplayModeNever.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleImageExport.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/ExampleSizePreset.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/FeatureCard.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/SmartBanner.vue +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/bgStyles.ts +0 -0
- /package/dist/src-vue/{banner-box-vue → banner-box}/sizePresets.ts +0 -0
- /package/dist/src-vue/{blog-vue → blog}/Basic.vue +0 -0
- /package/dist/src-vue/{blog-vue → blog}/Empty.vue +0 -0
- /package/dist/src-vue/{blog-vue → blog}/EmptyEnglish.vue +0 -0
- /package/dist/src-vue/{blog-vue → blog}/English.vue +0 -0
- /package/dist/src-vue/{confirm-dialog-vue → confirm-dialog}/Basic.vue +0 -0
- /package/dist/src-vue/{confirm-dialog-vue → confirm-dialog}/ConfirmDialog.vue +0 -0
- /package/dist/src-vue/{confirm-dialog-vue → confirm-dialog}/CustomButtons.vue +0 -0
- /package/dist/src-vue/{counter-vue → counter}/VueCounter.vue +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/Basic.vue +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/CustomBackground.vue +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/NoFrame.vue +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Deep Purple - Landscape.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Deep Purple - Portrait.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Gold - Landscape.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Gold - Portrait.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Silver - Landscape.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Silver - Portrait.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Space Black - Landscape.png +0 -0
- /package/dist/src-vue/{iPhone-vue → iPhone}/assets/iPhone 14 Pro - Space Black - Portrait.png +0 -0
- /package/dist/src-vue/{list-vue → list}/ListItem.vue +0 -0
- /package/dist/src-vue/{list-vue → list}/index.ts +0 -0
@@ -0,0 +1,234 @@
|
|
1
|
+
<!--
|
2
|
+
@component iPhoneWindow
|
3
|
+
|
4
|
+
@description
|
5
|
+
iPhoneWindow 组件模拟 iPhone 设备的外观,包含状态栏、时间显示和设备边框。
|
6
|
+
适用于创建移动应用界面原型或展示移动端设计效果。
|
7
|
+
|
8
|
+
@usage
|
9
|
+
基本用法:
|
10
|
+
```vue
|
11
|
+
<iPhoneWindow>
|
12
|
+
<div>应用内容</div>
|
13
|
+
</iPhoneWindow>
|
14
|
+
```
|
15
|
+
|
16
|
+
不显示边框:
|
17
|
+
```vue
|
18
|
+
<iPhoneWindow :showFrame="false">
|
19
|
+
<div>应用内容</div>
|
20
|
+
</iPhoneWindow>
|
21
|
+
```
|
22
|
+
|
23
|
+
自定义背景色:
|
24
|
+
```vue
|
25
|
+
<iPhoneWindow backgroundColor="bg-blue-50">
|
26
|
+
<div>应用内容</div>
|
27
|
+
</iPhoneWindow>
|
28
|
+
```
|
29
|
+
|
30
|
+
自定义高度:
|
31
|
+
```vue
|
32
|
+
<iPhoneWindow height="md">
|
33
|
+
<div>应用内容</div>
|
34
|
+
</iPhoneWindow>
|
35
|
+
```
|
36
|
+
|
37
|
+
使用较大高度:
|
38
|
+
```vue
|
39
|
+
<iPhoneWindow height="2xl">
|
40
|
+
<div>应用内容</div>
|
41
|
+
</iPhoneWindow>
|
42
|
+
```
|
43
|
+
|
44
|
+
@props
|
45
|
+
@prop {'sm'|'md'|'lg'|'xl'|'2xl'|'3xl'|'4xl'|'5xl'} [height='lg'] - 窗口高度选项
|
46
|
+
- sm: 256px (h-64)
|
47
|
+
- md: 320px (h-80)
|
48
|
+
- lg: 384px (h-96) - 默认值
|
49
|
+
- xl: 480px
|
50
|
+
- 2xl: 560px
|
51
|
+
- 3xl: 640px
|
52
|
+
- 4xl: 720px
|
53
|
+
- 5xl: 800px
|
54
|
+
@prop {String} [title=''] - 窗口标题
|
55
|
+
@prop {Array} [statusBarButtons=[]] - 状态栏按钮数组
|
56
|
+
@prop {Boolean} [withShadow=true] - 是否显示阴影效果
|
57
|
+
@prop {Boolean} [showFrame=true] - 是否显示 iPhone 边框
|
58
|
+
@prop {String} [backgroundColor=''] - 内容区域背景色
|
59
|
+
|
60
|
+
@slots
|
61
|
+
@slot default - 主要内容区域
|
62
|
+
|
63
|
+
@emits
|
64
|
+
-->
|
65
|
+
<script lang="ts">
|
66
|
+
import '../../style.ts';
|
67
|
+
import { AlertDialog } from '../../index-vue.ts';
|
68
|
+
import { ref, defineComponent } from 'vue';
|
69
|
+
import iphoneFrame from './assets/iPhone 14 Pro - Deep Purple - Portrait.png';
|
70
|
+
import StatusBarContent from './StatusBarContent.vue';
|
71
|
+
|
72
|
+
// iPhone边框图片-宽度
|
73
|
+
const iphoneFrameWidth = 1339;
|
74
|
+
// iPhone边框图片-高度
|
75
|
+
const iphoneFrameHeight = 2716;
|
76
|
+
// iPhone边框图片-状态栏离上边框的距离
|
77
|
+
const iphoneFrameStatusBarTop = 115;
|
78
|
+
// iPhone边框图片-状态栏高度
|
79
|
+
const iphoneFrameStatusBarHeight = 110;
|
80
|
+
|
81
|
+
// 比例-总宽度
|
82
|
+
const mainContentWidthAspectRatio = 1179 / iphoneFrameWidth;
|
83
|
+
// 比例-总高度
|
84
|
+
const mainContentHeightAspectRatio = 2556 / iphoneFrameHeight;
|
85
|
+
// 比例-状态栏高度
|
86
|
+
const iphoneFrameStatusBarHeightAspectRatio = iphoneFrameStatusBarHeight / iphoneFrameHeight;
|
87
|
+
// 比例-状态栏离上边框的距离
|
88
|
+
const iphoneFrameStatusBarTopAspectRatio = iphoneFrameStatusBarTop / iphoneFrameHeight;
|
89
|
+
|
90
|
+
// 预定义的高度选项
|
91
|
+
type HeightOption = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
|
92
|
+
|
93
|
+
const heightClasses: Record<HeightOption, string> = {
|
94
|
+
sm: 'cosy:h-64', // 256px
|
95
|
+
md: 'cosy:h-80', // 320px
|
96
|
+
lg: 'cosy:h-96', // 384px
|
97
|
+
xl: 'cosy:h-[480px]', // 480px
|
98
|
+
'2xl': 'cosy:h-[560px]', // 560px
|
99
|
+
'3xl': 'cosy:h-[640px]', // 640px
|
100
|
+
'4xl': 'cosy:h-[720px]', // 720px
|
101
|
+
'5xl': 'cosy:h-[800px]', // 800px
|
102
|
+
};
|
103
|
+
|
104
|
+
export default defineComponent({
|
105
|
+
name: 'iPhoneWindow',
|
106
|
+
components: {
|
107
|
+
AlertDialog,
|
108
|
+
StatusBarContent,
|
109
|
+
},
|
110
|
+
props: {
|
111
|
+
height: {
|
112
|
+
type: String as () => HeightOption,
|
113
|
+
default: 'lg',
|
114
|
+
validator: (value: string) => {
|
115
|
+
return Object.keys(heightClasses).includes(value);
|
116
|
+
},
|
117
|
+
},
|
118
|
+
debug: {
|
119
|
+
type: Boolean,
|
120
|
+
default: false,
|
121
|
+
},
|
122
|
+
title: {
|
123
|
+
type: String,
|
124
|
+
default: '',
|
125
|
+
},
|
126
|
+
statusBarButtons: {
|
127
|
+
type: Array,
|
128
|
+
default: () => [],
|
129
|
+
},
|
130
|
+
withShadow: {
|
131
|
+
type: Boolean,
|
132
|
+
default: true,
|
133
|
+
},
|
134
|
+
showFrame: {
|
135
|
+
type: Boolean,
|
136
|
+
default: true,
|
137
|
+
},
|
138
|
+
backgroundColor: {
|
139
|
+
type: String,
|
140
|
+
default: '',
|
141
|
+
},
|
142
|
+
},
|
143
|
+
setup(props) {
|
144
|
+
const showAlertDialog = ref(false);
|
145
|
+
const alertMessage = ref('');
|
146
|
+
|
147
|
+
// 获取图片URL
|
148
|
+
const frameSrc =
|
149
|
+
typeof iphoneFrame === 'string' ? iphoneFrame : iphoneFrame.src;
|
150
|
+
|
151
|
+
// 计算当前高度的缩放比例
|
152
|
+
const getScaleRatio = () => {
|
153
|
+
const heightValues = {
|
154
|
+
sm: 256,
|
155
|
+
md: 320,
|
156
|
+
lg: 384,
|
157
|
+
xl: 480,
|
158
|
+
'2xl': 560,
|
159
|
+
'3xl': 640,
|
160
|
+
'4xl': 720,
|
161
|
+
'5xl': 800,
|
162
|
+
};
|
163
|
+
const currentHeight = heightValues[props.height];
|
164
|
+
// 基于特定高度计算缩放比例
|
165
|
+
return currentHeight / 500;
|
166
|
+
};
|
167
|
+
|
168
|
+
return {
|
169
|
+
showAlertDialog,
|
170
|
+
alertMessage,
|
171
|
+
frameSrc,
|
172
|
+
heightClasses,
|
173
|
+
mainContentWidthAspectRatio,
|
174
|
+
mainContentHeightAspectRatio,
|
175
|
+
iphoneFrameWidth,
|
176
|
+
iphoneFrameHeight,
|
177
|
+
iphoneFrameStatusBarTop,
|
178
|
+
iphoneFrameStatusBarHeight,
|
179
|
+
iphoneFrameStatusBarHeightAspectRatio,
|
180
|
+
iphoneFrameStatusBarTopAspectRatio,
|
181
|
+
getScaleRatio,
|
182
|
+
};
|
183
|
+
},
|
184
|
+
});
|
185
|
+
</script>
|
186
|
+
|
187
|
+
<template>
|
188
|
+
<div :class="['cosy:relative', heightClasses[height]]" :style="{
|
189
|
+
aspectRatio: `${iphoneFrameWidth}/${iphoneFrameHeight}`,
|
190
|
+
// 调试模式,背景色为半透明的黄色
|
191
|
+
backgroundColor: debug ? 'rgba(255, 255, 0, 0.3)' : 'transparent',
|
192
|
+
}">
|
193
|
+
<!-- iPhone 边框 -->
|
194
|
+
<img v-if="showFrame" style="max-width: 100%; max-height: 100%;" :src="frameSrc" alt="iPhone frame" />
|
195
|
+
|
196
|
+
<!-- 顶部状态栏 -->
|
197
|
+
<div :style="{
|
198
|
+
position: 'absolute',
|
199
|
+
top: iphoneFrameStatusBarTopAspectRatio * 100 + '%',
|
200
|
+
height: iphoneFrameStatusBarHeightAspectRatio * 100 + '%',
|
201
|
+
width: mainContentWidthAspectRatio * 100 + '%',
|
202
|
+
left: '50%',
|
203
|
+
transform: 'translate(-50%, 0)',
|
204
|
+
paddingLeft: '5%',
|
205
|
+
paddingRight: '5%',
|
206
|
+
// 调试模式,背景色为半透明的红色
|
207
|
+
backgroundColor: debug ? 'rgba(255, 0, 0, 0.3)' : 'transparent',
|
208
|
+
zIndex: 10,
|
209
|
+
}">
|
210
|
+
<StatusBarContent :scaleRatio="getScaleRatio()" />
|
211
|
+
</div>
|
212
|
+
|
213
|
+
<!-- 内容区域 -->
|
214
|
+
<div class="cosy:inset-0 cosy:h-full" :style="{
|
215
|
+
width: mainContentWidthAspectRatio * 100 + '%',
|
216
|
+
height: mainContentHeightAspectRatio * 100 + '%',
|
217
|
+
// 水平居中
|
218
|
+
left: '50%',
|
219
|
+
// 垂直居中
|
220
|
+
top: '50%',
|
221
|
+
transform: 'translate(-50%, -50%)',
|
222
|
+
position: 'absolute',
|
223
|
+
// 调试模式,背景色为半透明的蓝色
|
224
|
+
backgroundColor: debug ? 'rgba(0, 0, 255, 0.3)' : 'transparent',
|
225
|
+
zIndex: 10,
|
226
|
+
}">
|
227
|
+
<div :class="[debug ? 'cosy:bg-green-300/50' : '', 'cosy:h-full cosy:w-full']">
|
228
|
+
<slot />
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<AlertDialog v-model="showAlertDialog" :message="alertMessage" />
|
234
|
+
</template>
|
@@ -1,31 +1,27 @@
|
|
1
1
|
import Basic from './Basic.vue';
|
2
|
-
import WeatherApp from './WeatherApp.vue';
|
3
2
|
import NoFrame from './NoFrame.vue';
|
4
3
|
import CustomBackground from './CustomBackground.vue';
|
5
4
|
import BasicSource from './Basic.vue?raw';
|
6
5
|
import NoFrameSource from './NoFrame.vue?raw';
|
7
6
|
import CustomBackgroundSource from './CustomBackground.vue?raw';
|
8
|
-
import
|
9
|
-
import { extractSimpleExample } from '../../utils/component';
|
7
|
+
import { extractSimpleExample } from '../utils/component';
|
10
8
|
|
11
9
|
// 导出主组件
|
12
10
|
export { default as iPhoneWindow } from './iPhoneWindow.vue';
|
13
11
|
|
14
12
|
// 将示例组件整合为一个对象导出
|
15
13
|
export const iPhoneWindowExamples = {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
CustomBackground,
|
14
|
+
Basic,
|
15
|
+
NoFrame,
|
16
|
+
CustomBackground,
|
20
17
|
};
|
21
18
|
|
22
19
|
// 导出示例组件的源代码(简化版本)
|
23
20
|
export const iPhoneWindowExampleCodes = {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
WeatherApp: extractSimpleExample(WeatherAppSource, 'iPhoneWindow'),
|
21
|
+
Basic: extractSimpleExample(BasicSource, 'iPhoneWindow'),
|
22
|
+
NoFrame: extractSimpleExample(NoFrameSource, 'iPhoneWindow'),
|
23
|
+
CustomBackground: extractSimpleExample(
|
24
|
+
CustomBackgroundSource,
|
25
|
+
'iPhoneWindow'
|
26
|
+
),
|
31
27
|
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import Icon from './VueIcon.vue';
|
3
|
+
|
4
|
+
interface Props {
|
5
|
+
/**
|
6
|
+
* 图标的大小
|
7
|
+
* @default "24px"
|
8
|
+
*/
|
9
|
+
size?: string;
|
10
|
+
/**
|
11
|
+
* 图标的颜色
|
12
|
+
* @default "currentColor"
|
13
|
+
*/
|
14
|
+
color?: string;
|
15
|
+
/**
|
16
|
+
* 自定义类名
|
17
|
+
*/
|
18
|
+
class?: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
22
|
+
size: '24px',
|
23
|
+
color: 'currentColor',
|
24
|
+
class: '',
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
|
28
|
+
<template>
|
29
|
+
<Icon name="xCircle" :size="size" :color="color" :class="props.class" />
|
30
|
+
</template>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<template>
|
2
|
+
<svg width="100%" height="100%" viewBox="0 0 25 12" fill="none" stroke="currentColor" style="display: block;">
|
3
|
+
<rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke-width="1" />
|
4
|
+
<rect x="2" y="2" width="18" height="8" rx="1" fill="currentColor" />
|
5
|
+
<path d="M23 4h1a1 1 0 011 1v2a1 1 0 01-1 1h-1V4z" fill="currentColor" />
|
6
|
+
</svg>
|
7
|
+
</template>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<template>
|
2
|
+
<svg width="100%" height="100%" viewBox="0 0 20 12" fill="none" stroke="currentColor" style="display: block;">
|
3
|
+
<path d="M1 11h2V6H1v5zm4 0h2V4H5v7zm4 0h2V2H9v9zm4 0h2V0h-2v11z" fill="currentColor" />
|
4
|
+
<path d="M17 11h2V0h-2v11z" fill="currentColor" opacity="0.4" />
|
5
|
+
</svg>
|
6
|
+
</template>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<template>
|
2
|
+
<svg width="100%" height="100%" viewBox="0 0 16 12" fill="currentColor" style="display: block;">
|
3
|
+
<path d="M8 10.5a1 1 0 100-2 1 1 0 000 2zM4.25 7.25a5 5 0 017.5 0l-1.06 1.06a3.5 3.5 0 00-5.38 0L4.25 7.25z" />
|
4
|
+
<path d="M1.75 4.75a8.5 8.5 0 0112.5 0l-1.06 1.06a7 7 0 00-10.38 0L1.75 4.75z" />
|
5
|
+
</svg>
|
6
|
+
</template>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import Icon from './VueIcon.vue';
|
3
|
+
|
4
|
+
interface Props {
|
5
|
+
/**
|
6
|
+
* 图标的大小
|
7
|
+
* @default "24px"
|
8
|
+
*/
|
9
|
+
size?: string;
|
10
|
+
/**
|
11
|
+
* 图标的颜色
|
12
|
+
* @default "currentColor"
|
13
|
+
*/
|
14
|
+
color?: string;
|
15
|
+
/**
|
16
|
+
* 自定义类名
|
17
|
+
*/
|
18
|
+
class?: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
22
|
+
size: '24px',
|
23
|
+
color: 'currentColor',
|
24
|
+
class: '',
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
|
28
|
+
<template>
|
29
|
+
<Icon name="checkCircle" :size="size" :color="color" :class="props.class" />
|
30
|
+
</template>
|
@@ -30,7 +30,7 @@ import { Icon } from 'cosy-ui';
|
|
30
30
|
<script setup lang="ts">
|
31
31
|
import '../../style.js';
|
32
32
|
import { computed } from 'vue';
|
33
|
-
import { iconData } from '../../assets/iconData';
|
33
|
+
import { iconData } from '../../src/assets/iconData';
|
34
34
|
|
35
35
|
interface Props {
|
36
36
|
/**
|
@@ -69,8 +69,18 @@ const viewBox = computed(() => {
|
|
69
69
|
</script>
|
70
70
|
|
71
71
|
<template>
|
72
|
-
<svg
|
73
|
-
|
72
|
+
<svg
|
73
|
+
xmlns="http://www.w3.org/2000/svg"
|
74
|
+
:width="size"
|
75
|
+
:height="size"
|
76
|
+
:viewBox="viewBox"
|
77
|
+
fill="none"
|
78
|
+
:stroke="color"
|
79
|
+
stroke-width="2"
|
80
|
+
stroke-linecap="round"
|
81
|
+
stroke-linejoin="round"
|
82
|
+
:class="props.class"
|
83
|
+
>
|
74
84
|
<path v-if="icon" :d="icon.path" />
|
75
85
|
</svg>
|
76
86
|
</template>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import Icon from './VueIcon.vue';
|
3
|
+
|
4
|
+
interface Props {
|
5
|
+
/**
|
6
|
+
* 图标的大小
|
7
|
+
* @default "24px"
|
8
|
+
*/
|
9
|
+
size?: string;
|
10
|
+
/**
|
11
|
+
* 图标的颜色
|
12
|
+
* @default "currentColor"
|
13
|
+
*/
|
14
|
+
color?: string;
|
15
|
+
/**
|
16
|
+
* 自定义类名
|
17
|
+
*/
|
18
|
+
class?: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
22
|
+
size: '24px',
|
23
|
+
color: 'currentColor',
|
24
|
+
class: '',
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
|
28
|
+
<template>
|
29
|
+
<Icon name="alertTriangle" :size="size" :color="color" :class="props.class" />
|
30
|
+
</template>
|
@@ -1 +1,22 @@
|
|
1
|
-
export { default as
|
1
|
+
export { default as AlertTriangleIcon } from './AlertTriangleIcon.vue';
|
2
|
+
export { default as CalendarIcon } from './CalendarIcon.vue';
|
3
|
+
export { default as CheckIcon } from './CheckIcon.vue';
|
4
|
+
export { default as CheckCircleIcon } from './CheckCircleIcon.vue';
|
5
|
+
export { default as ChevronDownIcon } from './ChevronDownIcon.vue';
|
6
|
+
export { default as ClipboardIcon } from './ClipboardIcon.vue';
|
7
|
+
export { default as CloseIcon } from './CloseIcon.vue';
|
8
|
+
export { default as ErrorIcon } from './ErrorIcon.vue';
|
9
|
+
export { default as InboxArchiveIcon } from './InboxArchiveIcon.vue';
|
10
|
+
export { default as InfoCircleIcon } from './InfoCircleIcon.vue';
|
11
|
+
export { default as InfoIcon } from './InfoIcon.vue';
|
12
|
+
export { default as LinkIcon } from './LinkIcon.vue';
|
13
|
+
export { default as MenuIcon } from './MenuIcon.vue';
|
14
|
+
export { default as SearchIcon } from './SearchIcon.vue';
|
15
|
+
export { default as SettingsIcon } from './SettingsIcon.vue';
|
16
|
+
export { default as SuccessIcon } from './SuccessIcon.vue';
|
17
|
+
export { default as UserIcon } from './UserIcon.vue';
|
18
|
+
export { default as WarningIcon } from './WarningIcon.vue';
|
19
|
+
export { default as XCircleIcon } from './XCircleIcon.vue';
|
20
|
+
export { default as IPhoneSignalIcon } from './IPhoneSignalIcon.vue';
|
21
|
+
export { default as IPhoneWifiIcon } from './IPhoneWifiIcon.vue';
|
22
|
+
export { default as IPhoneBatteryIcon } from './IPhoneBatteryIcon.vue';
|