forked from vikunja/frontend
chore: make this.value a computed property again
This commit is contained in:
parent
0d752c9d32
commit
dc02c09f19
|
@ -10,7 +10,6 @@
|
||||||
:class="{'is-open': visibleInternal}"
|
:class="{'is-open': visibleInternal}"
|
||||||
class="filter-popup"
|
class="filter-popup"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
@change="update"
|
|
||||||
ref="filters"
|
ref="filters"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
@ -38,10 +37,17 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visibleInternal: false,
|
visibleInternal: false,
|
||||||
value: null,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
value: {
|
||||||
|
get() {
|
||||||
|
return this.modelValue
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
this.$emit('update:modelValue', value)
|
||||||
|
},
|
||||||
|
},
|
||||||
hasFilters() {
|
hasFilters() {
|
||||||
// this.value also contains the page parameter which we don't want to include in filters
|
// 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
|
const {sort_by, order_by, filter_by, filter_value, filter_comparator, filter_concat, s} = this.value
|
||||||
|
@ -72,9 +78,6 @@ export default {
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
value() {
|
|
||||||
this.update()
|
|
||||||
},
|
|
||||||
visible() {
|
visible() {
|
||||||
this.visibleInternal = !this.visibleInternal
|
this.visibleInternal = !this.visibleInternal
|
||||||
},
|
},
|
||||||
|
@ -92,9 +95,6 @@ export default {
|
||||||
clearFilters() {
|
clearFilters() {
|
||||||
this.value = {...defaultParams()}
|
this.value = {...defaultParams()}
|
||||||
},
|
},
|
||||||
update() {
|
|
||||||
this.$emit('update:modelValue', this.value)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user