clearable.vue 649 B

12345678910111213141516
  1. <template>
  2. <el-select-v2 v-model="value1" :options="options" placeholder="Please select" style="width: 240px; margin-right: 16px; vertical-align: middle" multiple clearable />
  3. <el-select-v2 v-model="value2" :options="options" placeholder="Please select" style="width: 240px; vertical-align: middle" clearable />
  4. </template>
  5. <script lang="ts" setup>
  6. import { ref } from 'vue'
  7. const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
  8. const value1 = ref([])
  9. const value2 = ref()
  10. const options = Array.from({ length: 1000 }).map((_, idx) => ({
  11. value: `Option ${idx + 1}`,
  12. label: `${initials[idx % 10]}${idx}`,
  13. }))
  14. </script>