forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathicon.vue
49 lines (44 loc) · 879 Bytes
/
icon.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
<docs>
---
order: 7
title:
zh-CN: 设置图标
en-US: With Icon
---
## zh-CN
给 Segmented Item 设置 Icon。
## en-US
Set `icon` for Segmented Item.
</docs>
<template>
<a-segmented :options="data">
<template #icon="index">
<template v-if="index == 0">
<unordered-list-outlined />
</template>
<template v-if="index == 1">
<appstore-outlined />
</template>
</template>
</a-segmented>
</template>
<script lang="ts">
import { defineComponent, reactive } from 'vue';
import { UnorderedListOutlined, AppstoreOutlined } from '@ant-design/icons-vue';
export default defineComponent({
components: { UnorderedListOutlined, AppstoreOutlined },
setup() {
const data = reactive([
{
value: 'List',
},
{
value: 'Kanban',
},
]);
return {
data,
};
},
});
</script>