forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuffix.vue
70 lines (62 loc) · 1.26 KB
/
suffix.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
<docs>
---
order: 11
title:
zh-CN: 后缀图标
en-US: Suffix
---
## zh-CN
基本使用。
## en-US
Basic Usage
</docs>
<template>
<a-space>
<a-select
v-model:value="value1"
style="width: 120px"
:options="options1"
@change="handleChange"
>
<template #suffixIcon><smile-outlined class="ant-select-suffix" /></template>
</a-select>
<a-select v-model:value="value2" style="width: 120px" disabled :options="options2">
<template #suffixIcon><meh-outlined class="ant-select-suffix" /></template>
</a-select>
</a-space>
</template>
<script lang="ts" setup>
import { SmileOutlined, MehOutlined } from '@ant-design/icons-vue';
import type { SelectProps } from 'ant-design-vue';
import { ref } from 'vue';
const handleChange = (value: string) => {
console.log(`selected ${value}`);
};
const options1 = ref<SelectProps['options']>([
{
value: 'jack',
label: 'Jack',
},
{
value: 'lucy',
label: 'Lucy',
},
{
value: 'disabled',
label: 'Disabled',
disabled: true,
},
{
value: 'yiminghe',
label: 'Yiminghe',
},
]);
const options2 = ref<SelectProps['options']>([
{
value: 'lucy',
label: 'Lucy',
},
]);
const value1 = ref('lucy');
const value2 = ref('lucy');
</script>