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.
ant-design-vue/components/select/demo/multiple.vue

44 lines
797 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<docs>
---
order: 5
title:
zh-CN: 多选
en-US: Multiple selection
---
## zh-CN
多选从已有条目中选择scroll the menu
## en-US
Multiple selection, selecting from existing items (scroll the menu).
</docs>
<template>
<a-select
v-model:value="value"
mode="multiple"
style="width: 100%"
placeholder="Please select"
:options="[...Array(25)].map((_, i) => ({ value: (i + 10).toString(36) + (i + 1) }))"
@change="handleChange"
>
</a-select>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
setup() {
const handleChange = (value: string[]) => {
console.log(`selected ${value}`);
};
return {
handleChange,
value: ref(['a1', 'b2']),
};
},
});
</script>