mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 18:01:24 +08:00
43 lines
884 B
Vue
43 lines
884 B
Vue
|
<template>
|
||
|
<el-select-v2
|
||
|
v-model="value1"
|
||
|
:options="options"
|
||
|
placeholder="Please select"
|
||
|
style="width: 240px; margin-right: 16px; vertical-align: middle"
|
||
|
allow-create
|
||
|
filterable
|
||
|
multiple
|
||
|
clearable
|
||
|
/>
|
||
|
<el-select-v2
|
||
|
v-model="value2"
|
||
|
:options="options"
|
||
|
placeholder="Please select"
|
||
|
style="width: 240px; vertical-align: middle"
|
||
|
allow-create
|
||
|
filterable
|
||
|
clearable
|
||
|
/>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import { ref, defineComponent } from 'vue'
|
||
|
|
||
|
const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
|
||
|
|
||
|
export default defineComponent({
|
||
|
setup() {
|
||
|
return {
|
||
|
options: ref(
|
||
|
Array.from({ length: 1000 }).map((_, idx) => ({
|
||
|
value: `Option ${idx + 1}`,
|
||
|
label: `${initials[idx % 10]}${idx}`,
|
||
|
}))
|
||
|
),
|
||
|
value1: ref([]),
|
||
|
value2: ref(''),
|
||
|
}
|
||
|
},
|
||
|
})
|
||
|
</script>
|