could remove searched tag/place
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
multiple)
|
multiple)
|
||||||
template(v-slot:selection="data")
|
template(v-slot:selection="data")
|
||||||
v-chip(v-bind="data.attrs"
|
v-chip(v-bind="data.attrs"
|
||||||
|
close
|
||||||
|
@click:close='remove(data.item)'
|
||||||
:input-value="data.selected")
|
:input-value="data.selected")
|
||||||
v-avatar(left)
|
v-avatar(left)
|
||||||
v-icon {{data.item.type === 'place' ? 'mdi-map-marker' : 'mdi-tag' }}
|
v-icon {{data.item.type === 'place' ? 'mdi-map-marker' : 'mdi-tag' }}
|
||||||
@@ -62,6 +64,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
remove (item) {
|
||||||
|
const filters = {
|
||||||
|
tags: item.type === 'tag' ? this.filters.tags.filter(f => f !== item.id) : this.filters.tags,
|
||||||
|
places: item.type === 'place' ? this.filters.places.filter(f => f !== item.id) : this.filters.places
|
||||||
|
}
|
||||||
|
this.$emit('update', filters)
|
||||||
|
},
|
||||||
change (filters) {
|
change (filters) {
|
||||||
filters = {
|
filters = {
|
||||||
tags: filters.filter(t => t.type === 'tag').map(t => t.id),
|
tags: filters.filter(t => t.type === 'tag').map(t => t.id),
|
||||||
|
|||||||
Reference in New Issue
Block a user