Skip to content

Instantly share code, notes, and snippets.

@yuri1969
Created June 28, 2023 21:42
Show Gist options
  • Save yuri1969/d78726311c318f3fc80121053ea9e1c7 to your computer and use it in GitHub Desktop.
Save yuri1969/d78726311c318f3fc80121053ea9e1c7 to your computer and use it in GitHub Desktop.
Vue Element Plus select
<template>
<el-select
:model-value="options"
@update:model-value="onInput"
multiple
filterable
allow-create
default-first-option
clearable
collapse-tags
collapse-tags-tooltip
:reserve-keyword="false"
:persistent="false"
placeholder="Choose tags for your article"
>
<el-option
v-for="item in options"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const onInput = (value) => options.value = value.slice();
const value = ref<string[]>([]);
const options = ref(["foo", "bar"]);
// https://playcode.io/element_plus
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment