multiple.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div style="display: inline-block">
  3. <p style="margin-left: 10px">default</p>
  4. <el-select v-model="value1" multiple placeholder="Select" style="width: 240px">
  5. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  6. </el-select>
  7. </div>
  8. <div style="display: inline-block; margin-left: 20px">
  9. <p style="margin-left: 10px">use collapse-tags</p>
  10. <el-select v-model="value2" multiple collapse-tags placeholder="Select" style="width: 240px">
  11. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  12. </el-select>
  13. </div>
  14. <div style="display: inline-block; margin-left: 20px">
  15. <p style="margin-left: 10px">use collapse-tags-tooltip</p>
  16. <el-select v-model="value3" multiple collapse-tags collapse-tags-tooltip placeholder="Select" style="width: 240px">
  17. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  18. </el-select>
  19. </div>
  20. </template>
  21. <script lang="ts" setup>
  22. import { ref } from 'vue'
  23. const value1 = ref([])
  24. const value2 = ref([])
  25. const value3 = ref([])
  26. const options = [
  27. {
  28. value: 'Option1',
  29. label: 'Option1',
  30. },
  31. {
  32. value: 'Option2',
  33. label: 'Option2',
  34. },
  35. {
  36. value: 'Option3',
  37. label: 'Option3',
  38. },
  39. {
  40. value: 'Option4',
  41. label: 'Option4',
  42. },
  43. {
  44. value: 'Option5',
  45. label: 'Option5',
  46. },
  47. ]
  48. </script>