allow-create.vue 600 B

12345678910111213141516171819202122232425
  1. <template>
  2. <el-select v-model="value" multiple filterable allow-create default-first-option :reserve-keyword="false" placeholder="Choose tags for your article">
  3. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  4. </el-select>
  5. </template>
  6. <script lang="ts" setup>
  7. import { ref } from 'vue'
  8. const value = ref<string[]>([])
  9. const options = [
  10. {
  11. value: 'HTML',
  12. label: 'HTML',
  13. },
  14. {
  15. value: 'CSS',
  16. label: 'CSS',
  17. },
  18. {
  19. value: 'JavaScript',
  20. label: 'JavaScript',
  21. },
  22. ]
  23. </script>