From d31c8c7c57b230c77e3bce4b2064acbe48366238 Mon Sep 17 00:00:00 2001 From: Liberty Date: Thu, 21 Sep 2023 16:38:40 +0800 Subject: [PATCH] fix(subform): subform logic When a field under a subform is required or hidden and the subform has no logic, the field's own logic should be followed. --- packages/formEditor/preview.vue | 3 -- packages/hooks/use-props/index.js | 67 +++++++++++++++++++++---------- test/formTypes/subform.test.js | 27 +++++++++++++ 3 files changed, 73 insertions(+), 24 deletions(-) diff --git a/packages/formEditor/preview.vue b/packages/formEditor/preview.vue index fc38f95..fe0ce25 100644 --- a/packages/formEditor/preview.vue +++ b/packages/formEditor/preview.vue @@ -107,8 +107,6 @@ const setData1 = async (data, value) => { utils.addContext(e, state.store) }) const subforms = _.cloneDeep(state.fields.filter(e => e.type === 'subform')) - // For SubformLayout.jsx to get the first data - await nextTick() if (!_.isEmpty(value)) { for (const key in value) { state.remoteValues.set(key, value[key]) @@ -133,7 +131,6 @@ defineExpose({ setData, getData }) -window.state = state