0

我尝试在 Hyperstack中使用 mobile-stepper 组件( https://material-ui.com/demos/steppers/#mobile-stepper-progress ),但出现此错误:

Failed prop type: Invalid prop `nextButton` supplied to `MobileStepper`, expected a ReactNode. in MobileStepper

它只呈现进度条,但没有按钮。

尝试了各种方法,即:

Mui.MobileStepper( variant: "progress", steps: 6, position: "static",
                   nextButton: lambda { Mui.Button(size: "small") {'next'} },
                   backButton: lambda { Mui.Button(size: "small") {'back'} })
4

1 回答 1

3

您想将完整的 ReactNode 传递给 nextButton 和 backButton 道具。您还需要将组件转换为本机 javascript。您可以调用to_n任何 Hyperstack 组件将其转换为本机反应类。

Mui.MobileStepper( variant: "progress", steps: 6, position: "static",
                   nextButton: Mui.Button(size: "small") {'next'}.to_n,
                   backButton: Mui.Button(size: "small") {'back'}.to_n)
于 2019-04-15T18:23:31.983 回答