From 72ab230675532567e97ef0a05e65feef329c04dd Mon Sep 17 00:00:00 2001 From: Marius Heine Date: Fri, 8 Nov 2024 12:44:01 +0100 Subject: [PATCH] use global data for showIf predicate (#34) --- packages/former/src/components/FormNode.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/former/src/components/FormNode.vue b/packages/former/src/components/FormNode.vue index 611204a..7f77636 100644 --- a/packages/former/src/components/FormNode.vue +++ b/packages/former/src/components/FormNode.vue @@ -34,6 +34,7 @@ const data = defineModel('data', { default: () => ({}) }); const node = toRef(props, 'node'); const repeatedFormIdentifier = toRef(props, 'repeatedFormIdentifier'); +const globalData = inject('data'); const showIf = inject('showIf', false); const mode = inject('mode'); const components = inject('components'); @@ -68,7 +69,7 @@ const isShown = computed(() => { if (showIf) { // only evaluate showIf when we are not building up the form // but in edit mode we still want to show the component but highlighted - return showIf(node.value, data.value); + return showIf(node.value, globalData.value); } return true; });