chore: make this.value a computed property again

This commit is contained in:
kolaente 2021-10-31 16:33:25 +01:00
parent 0d752c9d32
commit dc02c09f19
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,6 @@
:class="{'is-open': visibleInternal}"
class="filter-popup"
v-model="value"
@change="update"
ref="filters"
/>
</template>
@ -38,10 +37,17 @@ export default {
data() {
return {
visibleInternal: false,
value: null,
}
},
computed: {
value: {
get() {
return this.modelValue
},
set(value) {
this.$emit('update:modelValue', value)
},
},
hasFilters() {
// this.value also contains the page parameter which we don't want to include in filters
const {sort_by, order_by, filter_by, filter_value, filter_comparator, filter_concat, s} = this.value
@ -72,9 +78,6 @@ export default {
},
immediate: true,
},
value() {
this.update()
},
visible() {
this.visibleInternal = !this.visibleInternal
},
@ -92,9 +95,6 @@ export default {
clearFilters() {
this.value = {...defaultParams()}
},
update() {
this.$emit('update:modelValue', this.value)
},
},
}
</script>