From ab3d008a4ee0b2917f167679fbb8d0924ee09df9 Mon Sep 17 00:00:00 2001 From: xnopasaranx Date: Fri, 11 Apr 2025 10:37:30 +0200 Subject: [PATCH 1/2] fix: attempt to fix bugs in viform, also watch for state.values to change in case custom values are updated instead of skel --- src/forms/ViForm.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/forms/ViForm.vue b/src/forms/ViForm.vue index b8b00fc..8ebf7f0 100644 --- a/src/forms/ViForm.vue +++ b/src/forms/ViForm.vue @@ -175,7 +175,14 @@ onBeforeMount(()=>{ watch(()=>props.skel,(oldVal,newVal)=>{ //dragging internalforms // structure wont be updated, cause of logic changes on structures - initForm(props.skel,undefined,state.value) + initForm(props.skel,undefined,state.values) + //rerun logics after dragging + logics() +}) +watch(()=>state.values,(oldVal,newVal)=>{ + // watch values in state also + // structure wont be updated, cause of logic changes on structures + initForm(props.skel,undefined,state.values) //rerun logics after dragging logics() }) From d3a09e95bc973b944f1616721881ccffbfd268bc Mon Sep 17 00:00:00 2001 From: xnopasaranx Date: Fri, 11 Apr 2025 17:44:37 +0200 Subject: [PATCH 2/2] Update ViForm.vue Now tested and proven to work. Had to make watcher 'deep' --- src/forms/ViForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forms/ViForm.vue b/src/forms/ViForm.vue index 8ebf7f0..6f5d2a5 100644 --- a/src/forms/ViForm.vue +++ b/src/forms/ViForm.vue @@ -185,7 +185,7 @@ watch(()=>state.values,(oldVal,newVal)=>{ initForm(props.skel,undefined,state.values) //rerun logics after dragging logics() -}) +},{ deep: true }) watch(()=>props.structure,(oldVal,newVal)=>{ //rerun logics if structure on mainform changes logics()