diff --git a/packages/amis-core/src/renderers/wrapControl.tsx b/packages/amis-core/src/renderers/wrapControl.tsx index aafddc21f..a8c24e22c 100644 --- a/packages/amis-core/src/renderers/wrapControl.tsx +++ b/packages/amis-core/src/renderers/wrapControl.tsx @@ -367,10 +367,7 @@ export function wrapControl< } else if (model) { const valueByName = getVariable(props.data, model.name); - if ( - valueByName !== undefined && - isEqual(props.defaultValue, prevProps.defaultValue) - ) { + if (isEqual(props.defaultValue, prevProps.defaultValue)) { // value 非公式表达式时,name 值优先,若 defaultValue 主动变动时,则使用 defaultValue if ( // 然后才是查看关联的 name 属性值是否变化 diff --git a/packages/amis/__tests__/renderers/Form/__snapshots__/index.test.tsx.snap b/packages/amis/__tests__/renderers/Form/__snapshots__/index.test.tsx.snap index 9c1892735..275c675e8 100644 --- a/packages/amis/__tests__/renderers/Form/__snapshots__/index.test.tsx.snap +++ b/packages/amis/__tests__/renderers/Form/__snapshots__/index.test.tsx.snap @@ -322,6 +322,177 @@ exports[`Renderer:Form initApi 1`] = ` `; +exports[`Renderer:Form reset 1`] = ` +
+
+
+

+ + + 表单 + + +

+
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+