From f5373bfdd6d0ff23069f40d8264e0176e78be9c7 Mon Sep 17 00:00:00 2001 From: zhangzhulei Date: Thu, 13 Apr 2023 10:18:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=94=B9normalizeSteps?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E6=89=A7=E8=A1=8C=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Wizard.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/amis/src/renderers/Wizard.tsx b/packages/amis/src/renderers/Wizard.tsx index 3ea0cde95..9872c03b7 100644 --- a/packages/amis/src/renderers/Wizard.tsx +++ b/packages/amis/src/renderers/Wizard.tsx @@ -349,8 +349,11 @@ export default class Wizard extends React.Component { const props = this.props; const {store, fetchSuccess, fetchFailed} = props; - // 步骤steps改变 - if (!isEqual(prevProps.steps, props.steps)) { + // 步骤steps、上下文数据data改变时需要执行normalizeSteps + if ( + !isEqual(prevProps.steps, props.steps) || + !isEqual(prevProps.data, props.data) + ) { this.normalizeSteps(props.data); } @@ -1339,7 +1342,6 @@ export class WizardRenderer extends Wizard { } setData(values: object, replace?: boolean) { - this.normalizeSteps(values); return this.props.store.updateData(values, undefined, replace); }