vuecssuiant-designantdreactantantd-vueenterprisefrontendui-designvue-antdvue-antd-uivue3vuecomponent
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.
46 lines
910 B
46 lines
910 B
<docs> |
|
--- |
|
order: 3 |
|
title: |
|
zh-CN: 自动分词 |
|
en-US: Automatic tokenization |
|
--- |
|
|
|
## zh-CN |
|
|
|
试下复制 `露西,杰克` 到输入框里。只在 tags 和 multiple 模式下可用。 |
|
|
|
## en-US |
|
|
|
Try to copy `Lucy,Jack` to the input. Only available in tags and multiple mode. |
|
|
|
</docs> |
|
|
|
<template> |
|
<a-select |
|
v-model:value="value" |
|
mode="tags" |
|
style="width: 100%" |
|
:token-separators="[',']" |
|
placeholder="Automatic tokenization" |
|
:options="options" |
|
@change="handleChange" |
|
></a-select> |
|
</template> |
|
<script lang="ts" setup> |
|
import { ref, watch } from 'vue'; |
|
import type { SelectProps } from 'ant-design-vue'; |
|
const options = ref<SelectProps['options']>([ |
|
{ |
|
value: 'a1', |
|
label: 'a1', |
|
}, |
|
]); |
|
const value = ref<string[]>([]); |
|
const handleChange = (value: []) => { |
|
console.log(`selected ${value}`); |
|
}; |
|
watch(value, () => { |
|
console.log('value', value.value); |
|
}); |
|
</script>
|
|
|