From a0f1913645c897f35ca669904a150b20c6007b51 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 17 Jul 2021 22:14:24 +0200 Subject: [PATCH] Add a v-model prop to listSearch --- src/components/tasks/partials/listSearch.vue | 15 +++++++++++++++ src/views/user/Settings.vue | 15 ++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/components/tasks/partials/listSearch.vue b/src/components/tasks/partials/listSearch.vue index 3a74be228..bb1a645f4 100644 --- a/src/components/tasks/partials/listSearch.vue +++ b/src/components/tasks/partials/listSearch.vue @@ -32,6 +32,11 @@ export default { foundLists: [], } }, + props: { + value: { + required: false, + }, + }, components: { Multiselect, }, @@ -39,6 +44,14 @@ export default { this.listSerivce = new ListService() this.list = new ListModel() }, + watch: { + value(newVal) { + this.list = newVal + }, + }, + mounted() { + this.list = this.value + }, methods: { findLists(query) { if (query === '') { @@ -58,7 +71,9 @@ export default { this.$set(this, 'foundLists', []) }, select(list) { + this.list = list this.$emit('selected', list) + this.$emit('input', list) }, namespace(namespaceId) { const namespace = this.$store.getters['namespaces/getNamespaceById'](namespaceId) diff --git a/src/views/user/Settings.vue b/src/views/user/Settings.vue index 416ad1b36..d7c2dff01 100644 --- a/src/views/user/Settings.vue +++ b/src/views/user/Settings.vue @@ -20,7 +20,7 @@ - +