diff --git a/packages/core/client/src/schema-component/antd/form-v2/Form.tsx b/packages/core/client/src/schema-component/antd/form-v2/Form.tsx index 3a423398e..30bff23d2 100644 --- a/packages/core/client/src/schema-component/antd/form-v2/Form.tsx +++ b/packages/core/client/src/schema-component/antd/form-v2/Form.tsx @@ -268,6 +268,10 @@ function getSubscriber( } } else { field[fieldName] = lastState?.value; + //字段隐藏时清空数据 + if (fieldName === 'display' && lastState?.value === 'none') { + field.value = null; + } } // 在这里清空 field.stateOfLinkageRules,就可以保证:当条件再次改变时,如果该字段没有和任何条件匹配,则需要把对应的值恢复到初始值;