element-plus/docs/examples/select-v2/allow-create.vue
Ryan2128 bbed5a5e96
fix(components): [select-v2] missing validate action when clear (#4892)
* fix(components): [select-v2] missing validate action when clear

- Fix the bug that missing validate when clear
- Add the same icon and style as the select component

* docs: [select-v2] fix demo render error
2021-12-22 17:37:42 +08:00

34 lines
755 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" setup>
import { ref } from 'vue'
const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
const value1 = ref([])
const value2 = ref('')
const options = Array.from({ length: 1000 }).map((_, idx) => ({
value: `Option ${idx + 1}`,
label: `${initials[idx % 10]}${idx}`,
}))
</script>