From 8e0da93476d378d559efe8a9ac1eddc2b4770b12 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 22 Dec 2024 13:55:04 +0100 Subject: [PATCH] fixed model switcher --- vue3/src/apps/tandoor/Tandoor.vue | 2 +- vue3/src/components/dialogs/ModelEditDialog.vue | 8 ++++++++ .../components/display/NavigationDrawerContextMenu.vue | 2 +- vue3/src/components/display/ShoppingListView.vue | 6 +++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/vue3/src/apps/tandoor/Tandoor.vue b/vue3/src/apps/tandoor/Tandoor.vue index f402a2665..e31ff75a9 100644 --- a/vue3/src/apps/tandoor/Tandoor.vue +++ b/vue3/src/apps/tandoor/Tandoor.vue @@ -95,7 +95,7 @@ - + diff --git a/vue3/src/components/dialogs/ModelEditDialog.vue b/vue3/src/components/dialogs/ModelEditDialog.vue index 3ad135a5d..72b07d21d 100644 --- a/vue3/src/components/dialogs/ModelEditDialog.vue +++ b/vue3/src/components/dialogs/ModelEditDialog.vue @@ -32,6 +32,14 @@ const editorComponent = shallowRef(defineAsyncComponent(() => import(`@/componen const model = defineModel({default: undefined}) const dialogActivator = (model.value !== undefined) ? undefined : props.activator +/** + * for some reason editorComponent is not updated automatically when prop is changed + * because of this watch prop changes and update manually if prop is changed + */ +watch(() => props.model, () => { + editorComponent.value = defineAsyncComponent(() => import(`@/components/model_editors/${getGenericModelFromString(props.model, t).model.name}Editor.vue`)) +}) + /** * Allow opening the model edit dialog trough v-model property of the dialog by watching for model changes */ diff --git a/vue3/src/components/display/NavigationDrawerContextMenu.vue b/vue3/src/components/display/NavigationDrawerContextMenu.vue index f35ff9ead..e7b789f63 100644 --- a/vue3/src/components/display/NavigationDrawerContextMenu.vue +++ b/vue3/src/components/display/NavigationDrawerContextMenu.vue @@ -3,7 +3,7 @@