MCPcopy
hub / github.com/baidu/amis / normalizeSteps

Method normalizeSteps

packages/amis/src/renderers/Wizard.tsx:386–410  ·  view source on GitHub ↗
(values: any)

Source from the content-addressed store, hash-verified

384 }
385
386 async normalizeSteps(values: any) {
387 const {steps, translate: __} = this.props;
388 const rawSteps: WizardStepSchema[] = [];
389 const stepsLength = steps.length;
390 // 这里有个bug,如果把第一个step隐藏,表单就不会渲染
391 for (let i = 0; i < stepsLength; i++) {
392 const hiddenFlag = await evalExpressionWithConditionBuilderAsync(
393 steps[i].hiddenOn,
394 values
395 );
396 !hiddenFlag && rawSteps.push(steps[i]);
397 }
398 this.setState({
399 rawSteps: rawSteps.map((step, index) => ({
400 ...step,
401 hiddenOn: '',
402 title:
403 step.title ||
404 step.label ||
405 __('Steps.step', {
406 index: index + 1
407 })
408 }))
409 });
410 }
411
412 async gotoStep(index: number) {
413 const steps = this.state.rawSteps;

Callers 2

componentDidMountMethod · 0.95
componentDidUpdateMethod · 0.95

Calls 3

pushMethod · 0.65
__Function · 0.50

Tested by

no test coverage detected