@mc-markets/ui 1.0.90 → 1.0.92
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/README.md +243 -40
- package/USAGE_GUIDE.md +339 -0
- package/dist/404.html +22 -22
- package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -11
- package/dist/index.mjs.map +1 -1
- package/dist/resolver.d.ts +26 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +8 -5
- package/packages/components/Alert/Alert.vue +139 -139
- package/packages/components/Banner/Banner.vue +299 -299
- package/packages/components/Breadcrumb/Breadcrumb.vue +113 -113
- package/packages/components/Breadcrumb/BreadcrumbSeparator.vue +31 -31
- package/packages/components/Button/Button.vue +17 -17
- package/packages/components/DatePicker/DatePicker.vue +85 -85
- package/packages/components/Dialog/Dialog.vue +61 -61
- package/packages/components/Empty/Empty.vue +73 -73
- package/packages/components/Form/Form.vue +30 -30
- package/packages/components/FormItem/FormItem.vue +19 -19
- package/packages/components/Icon/Icon.vue +210 -210
- package/packages/components/Input/Input.vue +15 -15
- package/packages/components/Message/Message.vue +503 -503
- package/packages/components/NotifiMessage/NotifiMessage.vue +293 -293
- package/packages/components/Notification/Notification.vue +19 -19
- package/packages/components/Option/Option.vue +13 -13
- package/packages/components/OptionGroup/OptionGroup.vue +13 -13
- package/packages/components/Pagination/Pagination.vue +61 -61
- package/packages/components/Radio/Radio.vue +67 -67
- package/packages/components/RadioButton/RadioButton.vue +110 -110
- package/packages/components/RadioGroup/RadioGroup.vue +155 -155
- package/packages/components/Select/Select.vue +22 -22
- package/packages/components/Switch/Switch.vue +47 -47
- package/packages/components/TabCard/TabCard.vue +107 -107
- package/packages/components/TabCard/TabCardItem.vue +105 -105
- package/packages/components/Table/Table.vue +17 -17
- package/packages/components/Table/TableColumn.vue +20 -20
- package/packages/components/Tabs/TabPane.vue +79 -79
- package/packages/components/Tabs/Tabs.vue +267 -267
- package/packages/components/Tag/Tag.vue +208 -211
- package/packages/components/Tooltip/Tooltip.vue +58 -58
- package/packages/hooks/useClassName.js +23 -23
- package/packages/resolver.js +179 -0
- package/packages/styles/README.md +129 -129
- package/packages/styles/colorfont/iconfont.css +1 -0
- package/packages/styles/components/button.scss +121 -121
- package/packages/styles/components/checkbox.scss +18 -18
- package/packages/styles/components/dialog.scss +47 -47
- package/packages/styles/components/form.scss +18 -18
- package/packages/styles/components/input.scss +14 -14
- package/packages/styles/components/select.scss +62 -62
- package/packages/styles/components/table.scss +37 -37
- package/packages/styles/components/tabs.scss +76 -76
- package/packages/styles/components/tag.scss +142 -142
- package/packages/styles/font/iconfont.scss +363 -363
- package/packages/styles/index.scss +94 -94
- package/packages/styles/variables/border-mode.css +6 -6
- package/packages/styles/variables/color-modes-dark.css +143 -143
- package/packages/styles/variables/index.scss +5 -5
- package/packages/styles/variables/primitives-style.css +112 -112
- package/packages/styles/variables/radius-mode.css +14 -14
- package/packages/styles/variables/spacing-mode.css +20 -20
- package/packages/styles/variables/typography-desktop.css +40 -40
- package/packages/styles/variables/typography-mobile.css +40 -40
- package/packages/utils/classNames.js +23 -23
- package/packages/utils/styleUtils.js +105 -105
|
@@ -1,299 +1,299 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="visible"
|
|
4
|
-
class="m-banner"
|
|
5
|
-
:class="[
|
|
6
|
-
`m-banner--${type}`,
|
|
7
|
-
{
|
|
8
|
-
'm-banner--closable': closable,
|
|
9
|
-
'm-banner--with-icon': icon || slots.icon
|
|
10
|
-
}
|
|
11
|
-
]"
|
|
12
|
-
:style="bannerStyle"
|
|
13
|
-
>
|
|
14
|
-
<div class="m-banner__content">
|
|
15
|
-
<!-- 图标插槽 -->
|
|
16
|
-
<div v-if="icon || slots.icon" class="m-banner__icon">
|
|
17
|
-
<slot name="icon">
|
|
18
|
-
<m-icon :name="icon" :size="iconSize" />
|
|
19
|
-
</slot>
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<!-- 主要内容 -->
|
|
23
|
-
<div class="m-banner__text">
|
|
24
|
-
<slot>{{ content }}</slot>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<!-- 关闭按钮 -->
|
|
28
|
-
<div v-if="closable" class="m-banner__close" @click="handleClose">
|
|
29
|
-
<m-icon name="lucide-x" :size="closeIconSize" />
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
|
|
35
|
-
<script setup>
|
|
36
|
-
import { ref, computed, watch, useSlots } from 'vue'
|
|
37
|
-
import MIcon from '../Icon/Icon.vue'
|
|
38
|
-
|
|
39
|
-
// 获取插槽
|
|
40
|
-
const slots = useSlots()
|
|
41
|
-
|
|
42
|
-
// 定义 props
|
|
43
|
-
const props = defineProps({
|
|
44
|
-
// 横幅内容
|
|
45
|
-
content: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ''
|
|
48
|
-
},
|
|
49
|
-
// 横幅类型
|
|
50
|
-
type: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: 'info',
|
|
53
|
-
validator: (value) => ['info', 'success', 'warning', 'error'].includes(value)
|
|
54
|
-
},
|
|
55
|
-
// 是否可关闭
|
|
56
|
-
closable: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: true
|
|
59
|
-
},
|
|
60
|
-
// 是否显示
|
|
61
|
-
visible: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: true
|
|
64
|
-
},
|
|
65
|
-
// 图标名称
|
|
66
|
-
icon: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: ''
|
|
69
|
-
},
|
|
70
|
-
// 图标大小
|
|
71
|
-
iconSize: {
|
|
72
|
-
type: [String, Number],
|
|
73
|
-
default: '16px'
|
|
74
|
-
},
|
|
75
|
-
// 关闭图标大小
|
|
76
|
-
closeIconSize: {
|
|
77
|
-
type: [String, Number],
|
|
78
|
-
default: '16px'
|
|
79
|
-
},
|
|
80
|
-
// 自定义背景色
|
|
81
|
-
backgroundColor: {
|
|
82
|
-
type: String,
|
|
83
|
-
default: ''
|
|
84
|
-
},
|
|
85
|
-
// 自定义文字颜色
|
|
86
|
-
textColor: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: ''
|
|
89
|
-
},
|
|
90
|
-
// 自定义边框颜色
|
|
91
|
-
borderColor: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: ''
|
|
94
|
-
},
|
|
95
|
-
// 持续时间(毫秒),0 表示不自动关闭
|
|
96
|
-
duration: {
|
|
97
|
-
type: Number,
|
|
98
|
-
default: 0
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
// 定义 emits
|
|
103
|
-
const emit = defineEmits(['close', 'update:visible'])
|
|
104
|
-
|
|
105
|
-
// 响应式数据
|
|
106
|
-
const internalVisible = ref(props.visible)
|
|
107
|
-
|
|
108
|
-
// 监听 visible prop 变化
|
|
109
|
-
watch(() => props.visible, (newVal) => {
|
|
110
|
-
internalVisible.value = newVal
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
// 计算样式
|
|
114
|
-
const bannerStyle = computed(() => {
|
|
115
|
-
const style = {}
|
|
116
|
-
|
|
117
|
-
if (props.backgroundColor) {
|
|
118
|
-
style.backgroundColor = props.backgroundColor
|
|
119
|
-
}
|
|
120
|
-
if (props.textColor) {
|
|
121
|
-
style.color = props.textColor
|
|
122
|
-
}
|
|
123
|
-
if (props.borderColor) {
|
|
124
|
-
style.borderColor = props.borderColor
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return style
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
// 默认图标映射
|
|
131
|
-
const defaultIcons = {
|
|
132
|
-
info: 'info',
|
|
133
|
-
success: 'check-circle',
|
|
134
|
-
warning: 'warning',
|
|
135
|
-
error: 'close-circle'
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 计算实际使用的图标
|
|
139
|
-
const actualIcon = computed(() => {
|
|
140
|
-
return props.icon || defaultIcons[props.type]
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
// 处理关闭
|
|
144
|
-
const handleClose = () => {
|
|
145
|
-
internalVisible.value = false
|
|
146
|
-
emit('update:visible', false)
|
|
147
|
-
emit('close')
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// 自动关闭逻辑
|
|
151
|
-
watch(internalVisible, (newVal) => {
|
|
152
|
-
if (newVal && props.duration > 0) {
|
|
153
|
-
setTimeout(() => {
|
|
154
|
-
handleClose()
|
|
155
|
-
}, props.duration)
|
|
156
|
-
}
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
// 定义组件名称
|
|
160
|
-
defineOptions({
|
|
161
|
-
name: 'MBanner'
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
// 暴露方法给父组件
|
|
165
|
-
defineExpose({
|
|
166
|
-
close: handleClose
|
|
167
|
-
})
|
|
168
|
-
</script>
|
|
169
|
-
|
|
170
|
-
<style scoped lang="scss">
|
|
171
|
-
.m-banner {
|
|
172
|
-
position: relative;
|
|
173
|
-
display: flex;
|
|
174
|
-
align-items: center;
|
|
175
|
-
min-height: 40px;
|
|
176
|
-
border-radius: 4px;
|
|
177
|
-
border: 1px solid;
|
|
178
|
-
font-size: 14px;
|
|
179
|
-
line-height: 1.5;
|
|
180
|
-
padding: 10px;
|
|
181
|
-
transition: all 0.3s ease;
|
|
182
|
-
|
|
183
|
-
&__content {
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
width: 100%;
|
|
187
|
-
flex: 1;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&__icon {
|
|
191
|
-
display: flex;
|
|
192
|
-
align-items: center;
|
|
193
|
-
margin-right: 8px;
|
|
194
|
-
flex-shrink: 0;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&__text {
|
|
198
|
-
flex: 1;
|
|
199
|
-
word-break: break-word;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
&__close {
|
|
203
|
-
display: flex;
|
|
204
|
-
align-items: center;
|
|
205
|
-
justify-content: center;
|
|
206
|
-
margin-left: 8px;
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
padding: 4px;
|
|
209
|
-
border-radius: 3px;
|
|
210
|
-
transition: background-color 0.2s ease;
|
|
211
|
-
flex-shrink: 0;
|
|
212
|
-
min-width: 20px;
|
|
213
|
-
min-height: 20px;
|
|
214
|
-
opacity: 0.7;
|
|
215
|
-
|
|
216
|
-
&:hover {
|
|
217
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
218
|
-
opacity: 1;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// 类型样式
|
|
223
|
-
&--info {
|
|
224
|
-
background-color: #e1f3ff;
|
|
225
|
-
border-color: #b3d8ff;
|
|
226
|
-
color: #0066cc;
|
|
227
|
-
|
|
228
|
-
.m-banner__close:hover {
|
|
229
|
-
background-color: rgba(0, 102, 204, 0.1);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&--success {
|
|
234
|
-
background-color: #f0f9ff;
|
|
235
|
-
border-color: #b3e5b3;
|
|
236
|
-
color: #00a854;
|
|
237
|
-
|
|
238
|
-
.m-banner__close:hover {
|
|
239
|
-
background-color: rgba(0, 168, 84, 0.1);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
&--warning {
|
|
244
|
-
background-color: #fff7e6;
|
|
245
|
-
border-color: #ffd591;
|
|
246
|
-
color: #fa8c16;
|
|
247
|
-
|
|
248
|
-
.m-banner__close:hover {
|
|
249
|
-
background-color: rgba(250, 140, 22, 0.1);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
&--error {
|
|
254
|
-
background-color: #fff2f0;
|
|
255
|
-
border-color: #ffccc7;
|
|
256
|
-
color: #ff4d4f;
|
|
257
|
-
|
|
258
|
-
.m-banner__close:hover {
|
|
259
|
-
background-color: rgba(255, 77, 79, 0.1);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// 带动画的关闭
|
|
264
|
-
&.m-banner-leave-active {
|
|
265
|
-
opacity: 0;
|
|
266
|
-
transform: translateY(-10px);
|
|
267
|
-
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// 深色主题适配
|
|
272
|
-
@media (prefers-color-scheme: dark) {
|
|
273
|
-
.m-banner {
|
|
274
|
-
&--info {
|
|
275
|
-
background-color: rgba(24, 144, 255, 0.1);
|
|
276
|
-
border-color: rgba(24, 144, 255, 0.3);
|
|
277
|
-
color: #69c0ff;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
&--success {
|
|
281
|
-
background-color: rgba(82, 196, 26, 0.1);
|
|
282
|
-
border-color: rgba(82, 196, 26, 0.3);
|
|
283
|
-
color: #95de64;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
&--warning {
|
|
287
|
-
background-color: rgba(250, 173, 20, 0.1);
|
|
288
|
-
border-color: rgba(250, 173, 20, 0.3);
|
|
289
|
-
color: #ffd666;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
&--error {
|
|
293
|
-
background-color: rgba(255, 77, 79, 0.1);
|
|
294
|
-
border-color: rgba(255, 77, 79, 0.3);
|
|
295
|
-
color: #ff7875;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="visible"
|
|
4
|
+
class="m-banner"
|
|
5
|
+
:class="[
|
|
6
|
+
`m-banner--${type}`,
|
|
7
|
+
{
|
|
8
|
+
'm-banner--closable': closable,
|
|
9
|
+
'm-banner--with-icon': icon || slots.icon
|
|
10
|
+
}
|
|
11
|
+
]"
|
|
12
|
+
:style="bannerStyle"
|
|
13
|
+
>
|
|
14
|
+
<div class="m-banner__content">
|
|
15
|
+
<!-- 图标插槽 -->
|
|
16
|
+
<div v-if="icon || slots.icon" class="m-banner__icon">
|
|
17
|
+
<slot name="icon">
|
|
18
|
+
<m-icon :name="icon" :size="iconSize" />
|
|
19
|
+
</slot>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- 主要内容 -->
|
|
23
|
+
<div class="m-banner__text">
|
|
24
|
+
<slot>{{ content }}</slot>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- 关闭按钮 -->
|
|
28
|
+
<div v-if="closable" class="m-banner__close" @click="handleClose">
|
|
29
|
+
<m-icon name="lucide-x" :size="closeIconSize" />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup>
|
|
36
|
+
import { ref, computed, watch, useSlots } from 'vue'
|
|
37
|
+
import MIcon from '../Icon/Icon.vue'
|
|
38
|
+
|
|
39
|
+
// 获取插槽
|
|
40
|
+
const slots = useSlots()
|
|
41
|
+
|
|
42
|
+
// 定义 props
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
// 横幅内容
|
|
45
|
+
content: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ''
|
|
48
|
+
},
|
|
49
|
+
// 横幅类型
|
|
50
|
+
type: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'info',
|
|
53
|
+
validator: (value) => ['info', 'success', 'warning', 'error'].includes(value)
|
|
54
|
+
},
|
|
55
|
+
// 是否可关闭
|
|
56
|
+
closable: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
},
|
|
60
|
+
// 是否显示
|
|
61
|
+
visible: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: true
|
|
64
|
+
},
|
|
65
|
+
// 图标名称
|
|
66
|
+
icon: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: ''
|
|
69
|
+
},
|
|
70
|
+
// 图标大小
|
|
71
|
+
iconSize: {
|
|
72
|
+
type: [String, Number],
|
|
73
|
+
default: '16px'
|
|
74
|
+
},
|
|
75
|
+
// 关闭图标大小
|
|
76
|
+
closeIconSize: {
|
|
77
|
+
type: [String, Number],
|
|
78
|
+
default: '16px'
|
|
79
|
+
},
|
|
80
|
+
// 自定义背景色
|
|
81
|
+
backgroundColor: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: ''
|
|
84
|
+
},
|
|
85
|
+
// 自定义文字颜色
|
|
86
|
+
textColor: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: ''
|
|
89
|
+
},
|
|
90
|
+
// 自定义边框颜色
|
|
91
|
+
borderColor: {
|
|
92
|
+
type: String,
|
|
93
|
+
default: ''
|
|
94
|
+
},
|
|
95
|
+
// 持续时间(毫秒),0 表示不自动关闭
|
|
96
|
+
duration: {
|
|
97
|
+
type: Number,
|
|
98
|
+
default: 0
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
// 定义 emits
|
|
103
|
+
const emit = defineEmits(['close', 'update:visible'])
|
|
104
|
+
|
|
105
|
+
// 响应式数据
|
|
106
|
+
const internalVisible = ref(props.visible)
|
|
107
|
+
|
|
108
|
+
// 监听 visible prop 变化
|
|
109
|
+
watch(() => props.visible, (newVal) => {
|
|
110
|
+
internalVisible.value = newVal
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
// 计算样式
|
|
114
|
+
const bannerStyle = computed(() => {
|
|
115
|
+
const style = {}
|
|
116
|
+
|
|
117
|
+
if (props.backgroundColor) {
|
|
118
|
+
style.backgroundColor = props.backgroundColor
|
|
119
|
+
}
|
|
120
|
+
if (props.textColor) {
|
|
121
|
+
style.color = props.textColor
|
|
122
|
+
}
|
|
123
|
+
if (props.borderColor) {
|
|
124
|
+
style.borderColor = props.borderColor
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return style
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
// 默认图标映射
|
|
131
|
+
const defaultIcons = {
|
|
132
|
+
info: 'info',
|
|
133
|
+
success: 'check-circle',
|
|
134
|
+
warning: 'warning',
|
|
135
|
+
error: 'close-circle'
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// 计算实际使用的图标
|
|
139
|
+
const actualIcon = computed(() => {
|
|
140
|
+
return props.icon || defaultIcons[props.type]
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// 处理关闭
|
|
144
|
+
const handleClose = () => {
|
|
145
|
+
internalVisible.value = false
|
|
146
|
+
emit('update:visible', false)
|
|
147
|
+
emit('close')
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// 自动关闭逻辑
|
|
151
|
+
watch(internalVisible, (newVal) => {
|
|
152
|
+
if (newVal && props.duration > 0) {
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
handleClose()
|
|
155
|
+
}, props.duration)
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
// 定义组件名称
|
|
160
|
+
defineOptions({
|
|
161
|
+
name: 'MBanner'
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
// 暴露方法给父组件
|
|
165
|
+
defineExpose({
|
|
166
|
+
close: handleClose
|
|
167
|
+
})
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<style scoped lang="scss">
|
|
171
|
+
.m-banner {
|
|
172
|
+
position: relative;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
min-height: 40px;
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
border: 1px solid;
|
|
178
|
+
font-size: 14px;
|
|
179
|
+
line-height: 1.5;
|
|
180
|
+
padding: 10px;
|
|
181
|
+
transition: all 0.3s ease;
|
|
182
|
+
|
|
183
|
+
&__content {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
width: 100%;
|
|
187
|
+
flex: 1;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&__icon {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
margin-right: 8px;
|
|
194
|
+
flex-shrink: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&__text {
|
|
198
|
+
flex: 1;
|
|
199
|
+
word-break: break-word;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&__close {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
margin-left: 8px;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
padding: 4px;
|
|
209
|
+
border-radius: 3px;
|
|
210
|
+
transition: background-color 0.2s ease;
|
|
211
|
+
flex-shrink: 0;
|
|
212
|
+
min-width: 20px;
|
|
213
|
+
min-height: 20px;
|
|
214
|
+
opacity: 0.7;
|
|
215
|
+
|
|
216
|
+
&:hover {
|
|
217
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
218
|
+
opacity: 1;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// 类型样式
|
|
223
|
+
&--info {
|
|
224
|
+
background-color: #e1f3ff;
|
|
225
|
+
border-color: #b3d8ff;
|
|
226
|
+
color: #0066cc;
|
|
227
|
+
|
|
228
|
+
.m-banner__close:hover {
|
|
229
|
+
background-color: rgba(0, 102, 204, 0.1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&--success {
|
|
234
|
+
background-color: #f0f9ff;
|
|
235
|
+
border-color: #b3e5b3;
|
|
236
|
+
color: #00a854;
|
|
237
|
+
|
|
238
|
+
.m-banner__close:hover {
|
|
239
|
+
background-color: rgba(0, 168, 84, 0.1);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&--warning {
|
|
244
|
+
background-color: #fff7e6;
|
|
245
|
+
border-color: #ffd591;
|
|
246
|
+
color: #fa8c16;
|
|
247
|
+
|
|
248
|
+
.m-banner__close:hover {
|
|
249
|
+
background-color: rgba(250, 140, 22, 0.1);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
&--error {
|
|
254
|
+
background-color: #fff2f0;
|
|
255
|
+
border-color: #ffccc7;
|
|
256
|
+
color: #ff4d4f;
|
|
257
|
+
|
|
258
|
+
.m-banner__close:hover {
|
|
259
|
+
background-color: rgba(255, 77, 79, 0.1);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// 带动画的关闭
|
|
264
|
+
&.m-banner-leave-active {
|
|
265
|
+
opacity: 0;
|
|
266
|
+
transform: translateY(-10px);
|
|
267
|
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// 深色主题适配
|
|
272
|
+
@media (prefers-color-scheme: dark) {
|
|
273
|
+
.m-banner {
|
|
274
|
+
&--info {
|
|
275
|
+
background-color: rgba(24, 144, 255, 0.1);
|
|
276
|
+
border-color: rgba(24, 144, 255, 0.3);
|
|
277
|
+
color: #69c0ff;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&--success {
|
|
281
|
+
background-color: rgba(82, 196, 26, 0.1);
|
|
282
|
+
border-color: rgba(82, 196, 26, 0.3);
|
|
283
|
+
color: #95de64;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
&--warning {
|
|
287
|
+
background-color: rgba(250, 173, 20, 0.1);
|
|
288
|
+
border-color: rgba(250, 173, 20, 0.3);
|
|
289
|
+
color: #ffd666;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&--error {
|
|
293
|
+
background-color: rgba(255, 77, 79, 0.1);
|
|
294
|
+
border-color: rgba(255, 77, 79, 0.3);
|
|
295
|
+
color: #ff7875;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
</style>
|