-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
/
theme.vue
84 lines (80 loc) 路 1.82 KB
/
theme.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
<div class="tag-group my-2 flex flex-wrap gap-1 items-center">
<span class="tag-group__title m-1 line-height-2">Dark</span>
<el-tag
v-for="item in items"
:key="item.label"
:type="item.type"
class="mx-1"
effect="dark"
>
{{ item.label }}
</el-tag>
<el-tag
v-for="item in items"
:key="item.label"
:type="item.type"
class="mx-1"
effect="dark"
closable
>
{{ item.label }}
</el-tag>
</div>
<div class="tag-group my-2 flex flex-wrap gap-1 items-center">
<span class="tag-group__title m-1">Light</span>
<el-tag
v-for="item in items"
:key="item.label"
class="mx-1"
:type="item.type"
effect="light"
>
{{ item.label }}
</el-tag>
<el-tag
v-for="item in items"
:key="item.label"
class="mx-1"
:type="item.type"
effect="light"
closable
>
{{ item.label }}
</el-tag>
</div>
<div class="tag-group my-2 flex flex-wrap gap-1 items-center">
<span class="tag-group__title m-1">Plain</span>
<el-tag
v-for="item in items"
:key="item.label"
class="mx-1"
:type="item.type"
effect="plain"
>
{{ item.label }}
</el-tag>
<el-tag
v-for="item in items"
:key="item.label"
class="mx-1"
:type="item.type"
effect="plain"
closable
>
{{ item.label }}
</el-tag>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import type { TagProps } from 'element-plus'
type Item = { type: TagProps['type']; label: string }
const items = ref<Array<Item>>([
{ type: '', label: 'Tag 1' },
{ type: 'success', label: 'Tag 2' },
{ type: 'info', label: 'Tag 3' },
{ type: 'danger', label: 'Tag 4' },
{ type: 'warning', label: 'Tag 5' },
])
</script>