ant-design-vue/components/select/demo/multiple.vue

43 lines
794 B
Vue
Raw Blame History

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>