From db8b8812af731fb6acbdd1aec173e37b84066eea Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 13 Sep 2022 15:30:33 +0000 Subject: [PATCH] feat: use v-model more consequent (#2356) Co-authored-by: Dominik Pschenitschni Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2356 Reviewed-by: konrad Co-authored-by: Dominik Pschenitschni Co-committed-by: Dominik Pschenitschni --- src/components/date/datepickerWithRange.vue | 3 +- src/components/input/colorPicker.vue | 3 +- src/components/input/datepicker.vue | 3 +- src/components/input/editor.vue | 3 +- .../list/list-settings-dropdown.vue | 4 +-- src/components/list/partials/filters.vue | 29 ++++++++++--------- src/components/misc/subscription.vue | 29 ++++++++----------- .../namespace/namespace-settings-dropdown.vue | 5 ++-- src/components/tasks/edit-task.vue | 2 +- src/components/tasks/partials/comments.vue | 4 +-- src/components/tasks/partials/description.vue | 2 +- src/components/tasks/partials/editLabels.vue | 4 +-- .../tasks/partials/percentDoneSelect.vue | 3 +- .../tasks/partials/prioritySelect.vue | 9 +++--- src/components/tasks/partials/reminders.vue | 3 +- src/components/tasks/partials/repeatAfter.vue | 3 +- src/views/tasks/ShowTasks.vue | 2 +- src/views/tasks/TaskDetailView.vue | 23 ++++++++------- 18 files changed, 63 insertions(+), 71 deletions(-) diff --git a/src/components/date/datepickerWithRange.vue b/src/components/date/datepickerWithRange.vue index 848877c4..e27acf7a 100644 --- a/src/components/date/datepickerWithRange.vue +++ b/src/components/date/datepickerWithRange.vue @@ -85,7 +85,7 @@ import DatemathHelp from '@/components/date/datemathHelp.vue' const store = useStore() const {t} = useI18n({useScope: 'global'}) -const emit = defineEmits(['dateChanged', 'update:modelValue']) +const emit = defineEmits(['update:modelValue']) const props = defineProps({ modelValue: { required: false, @@ -127,7 +127,6 @@ function emitChanged() { dateFrom: from.value === '' ? null : from.value, dateTo: to.value === '' ? null : to.value, } - emit('dateChanged', args) emit('update:modelValue', args) } diff --git a/src/components/input/colorPicker.vue b/src/components/input/colorPicker.vue index 335afce3..1cb0c58e 100644 --- a/src/components/input/colorPicker.vue +++ b/src/components/input/colorPicker.vue @@ -68,7 +68,7 @@ export default defineComponent({ default: 'top', }, }, - emits: ['update:modelValue', 'change'], + emits: ['update:modelValue'], watch: { modelValue: { handler(modelValue) { @@ -98,7 +98,6 @@ export default defineComponent({ this.lastChangeTimeout = setTimeout(() => { this.$emit('update:modelValue', this.color) - this.$emit('change') }, 500) }, reset() { diff --git a/src/components/input/datepicker.vue b/src/components/input/datepicker.vue index d5e35e33..733a9fab 100644 --- a/src/components/input/datepicker.vue +++ b/src/components/input/datepicker.vue @@ -131,7 +131,7 @@ export default defineComponent({ default: false, }, }, - emits: ['update:modelValue', 'change', 'close', 'close-on-change'], + emits: ['update:modelValue', 'close', 'close-on-change'], mounted() { document.addEventListener('click', this.hideDatePopup) }, @@ -186,7 +186,6 @@ export default defineComponent({ updateData() { this.changed = true this.$emit('update:modelValue', this.date) - this.$emit('change', this.date) }, toggleDatePopup() { if (this.disabled) { diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index e2ec5d66..839df338 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -136,7 +136,7 @@ export default defineComponent({ default: '', }, }, - emits: ['update:modelValue', 'change'], + emits: ['update:modelValue'], computed: { showPreviewText() { return this.isPreviewActive && this.text === '' && this.emptyText !== '' @@ -212,7 +212,6 @@ export default defineComponent({ this.changeTimeout = setTimeout(() => { this.$emit('update:modelValue', this.text) - this.$emit('change', this.text) }, timeout) }, replaceAt(str, index, replacement) { diff --git a/src/components/list/list-settings-dropdown.vue b/src/components/list/list-settings-dropdown.vue index 8e6cbe3a..c32078a2 100644 --- a/src/components/list/list-settings-dropdown.vue +++ b/src/components/list/list-settings-dropdown.vue @@ -60,8 +60,8 @@ :is-button="false" entity="list" :entity-id="list.id" - :subscription="list.subscription" - @change="sub => subscription = sub" + :model-value="list.subscription" + @update:model-value="sub => subscription = sub" type="dropdown" /> {{ $t('task.attributes.dueDate') }}
+ v-model="filters.dueDate" + @update:model-value="values => setDateFilter('due_date', values)" + >