每一步的提交接口可以决定操作完后跳至哪一步

This commit is contained in:
liaoxuezhi 2019-07-17 16:31:14 +08:00
parent 5de46b09ec
commit 586a1d3609
1 changed files with 4 additions and 2 deletions

View File

@ -316,7 +316,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
);
},
})
.then(() => this.gotoStep(this.state.currentStep + 1))
.then((value:any) => this.gotoStep(value && typeof value.step === "number" ? value.step : this.state.currentStep + 1))
.catch(e => {
// do nothing
});
@ -363,7 +363,9 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
return value;
}
if (redirect) {
if (value && typeof value.step === "number") {
this.gotoStep(value.step);
} else if (redirect) {
env.updateLocation(filter(redirect, store.data));
} else if (reload) {
this.reloadTarget(reload, store.data);