我尝试在Hyperstack中使用移动步进器组件(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'} })
答案 0 :(得分:3)
您想将完整的ReactNode传递给nextButton和backButton道具。您还需要将组件转换为本地javascript。您可以在任何Hyperstack组件上调用to_n
,以将其转换为本地React类。
Mui.MobileStepper( variant: "progress", steps: 6, position: "static",
nextButton: Mui.Button(size: "small") {'next'}.to_n,
backButton: Mui.Button(size: "small") {'back'}.to_n)