You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.0 KiB
98 lines
2.0 KiB
<docs>
|
|
---
|
|
order: 12
|
|
debug: true
|
|
title:
|
|
zh-CN: 后缀图标
|
|
en-US: Suffix
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
最简单的用法。
|
|
|
|
## en-US
|
|
|
|
The most basic usage.
|
|
</docs>
|
|
|
|
<template>
|
|
<a-space direction="vertical" style="width: 100%">
|
|
<a-tree-select
|
|
v-model:value="value"
|
|
show-search
|
|
style="width: 100%"
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
placeholder="Please select"
|
|
allow-clear
|
|
tree-default-expand-all
|
|
:tree-data="treeData"
|
|
:field-names="{
|
|
children: 'children',
|
|
value: 'value',
|
|
label: 'title',
|
|
}"
|
|
tree-node-filter-prop="title"
|
|
>
|
|
<template #suffixIcon><SmileOutlined /></template>
|
|
</a-tree-select>
|
|
|
|
<a-tree-select
|
|
v-model:value="value1"
|
|
show-search
|
|
style="width: 100%"
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
placeholder="Please select"
|
|
allow-clear
|
|
multiple
|
|
show-arrow
|
|
tree-default-expand-all
|
|
:tree-data="treeData"
|
|
:field-names="{
|
|
children: 'children',
|
|
value: 'value',
|
|
label: 'title',
|
|
}"
|
|
tree-node-filter-prop="title"
|
|
>
|
|
<template #suffixIcon><SmileOutlined /></template>
|
|
</a-tree-select>
|
|
</a-space>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import { ref, watch } from 'vue';
|
|
import { SmileOutlined } from '@ant-design/icons-vue';
|
|
import type { TreeSelectProps } from 'ant-design-vue';
|
|
const value = ref<string>();
|
|
const value1 = ref<string[]>([]);
|
|
const treeData = ref<TreeSelectProps['treeData']>([
|
|
{
|
|
title: 'parent 1',
|
|
value: 'parent 1',
|
|
children: [
|
|
{
|
|
title: 'parent 1-0',
|
|
value: 'parent 1-0',
|
|
children: [
|
|
{
|
|
title: 'my leaf',
|
|
value: 'leaf1',
|
|
},
|
|
{
|
|
title: 'your leaf',
|
|
value: 'leaf2',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: 'parent 1-1',
|
|
value: 'parent 1-1',
|
|
},
|
|
],
|
|
},
|
|
]);
|
|
watch(value, () => {
|
|
console.log('select', value.value);
|
|
});
|
|
</script>
|