I'm using vue-select to have a search with select in my vue application. For example, when I click on an option in vue-select, it will be sent to me in another object and it will disappear after the selector.
How could I do that? I did something like that but it's not ok
Selector
<v-select
v-model="value"
:options="dataTags"
multiple
@click="onAdd()"
placeholder="Select your data">
</v-select>
Js
<script>
export default {
props: {
dataTags: {
type: Object,
required: true
}
},
data() {
return {
value: '',
Items: {
selected_items: []
}
}
},
methods: {
onAdd() {
this.Items.selected_items.push(this.value);
this.value = '';
}
}
}
</script>
And data tags are just an array of those tags, nothing special. It is based on an id and tag. So how can I proceed to send the selected items to a new object and make them disappear from the selector? Can I hide them in some way?