reset items on selection

This commit is contained in:
Mohit Panjwani
2020-05-12 13:11:29 +05:30
parent 450c265ded
commit e07532961e

View File

@ -20,7 +20,7 @@
label="name" label="name"
class="multi-select-item" class="multi-select-item"
@value="onTextChange" @value="onTextChange"
@select="(val) => $emit('select', val)" @select="onSelect"
> >
<div slot="afterList"> <div slot="afterList">
<button type="button" class="list-add-button" @click="openItemModal"> <button type="button" class="list-add-button" @click="openItemModal">
@ -131,6 +131,10 @@ export default {
'data': {taxPerItem: this.taxPerItem, taxes: this.taxes} 'data': {taxPerItem: this.taxPerItem, taxes: this.taxes}
}) })
}, },
onSelect(val) {
this.$emit('select', val)
this.fetchItems()
},
deselectItem () { deselectItem () {
this.itemSelect = null this.itemSelect = null
this.$emit('deselect') this.$emit('deselect')