Skip to content

Commit

Permalink
use global data for showIf predicate (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusheine authored Nov 8, 2024
1 parent 21dab92 commit 72ab230
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/former/src/components/FormNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const data = defineModel<FormData>('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');
Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 72ab230

Please sign in to comment.