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 8cf79fc821..cb9660b85d 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 @@ -146,12 +146,16 @@ const WithForm = (props: WithFormProps) => { variables, localVariables, }); + // 如果是 linkageRules 数组的最后一个元素 if (index === linkageRules.length - 1) { - setTimeout(() => - linkagefields.map((v) => { - v.linkageProperty = {}; - }), - ); + // 等待异步操作完成 + await new Promise((resolve) => setTimeout(resolve, 0)); + // 清空 linkagefields 数组中对象的属性 + linkagefields.forEach((v) => { + v.linkageProperty = {}; + }); + // 清空 linkagefields 数组 + linkagefields.length = 0; } }), );