framework7“stepperChange”中的REACT事件无法正常工作

问题描述 投票:1回答:1

当我计数并倒计时时,“stepperChange”事件不会触发。

文档说有一个stepperChange事件:https://framework7.io/react/stepper.html#stepper-events


  constructor(props){
    super(props);

    this.state = {
      Produkte: [
        {id:201, name:"Apple", amount: 2},
        {id:202, name:"Bananna", amount: 2}
      ]
    }
  }
  amountChanged(){
    console.log("hello world! "+Math.random());
  } 
  render(){
    return(
      <Page>
        <List>
          {this.state.Produkte.map((produkt) => {
              return(
                <ListItem key={produkt.id} title={produkt.name}>
                  <Stepper stepperChange={this.amountChanged.bind(this)} round fill value={produkt.amount} min={0} max={100} step={1} autorepeat={true} wraps={false} manualInputMode={true} decimalPoint={2}></Stepper>
                </ListItem>      
              );
          })}

        </List>
      </Page>
    );
   }
 }

当我点击步进器时,现在登录控制台。

reactjs events html-framework-7
1个回答
1
投票

根据文档,它是onStepperChange而不是stepperChange。

© www.soinside.com 2019 - 2024. All rights reserved.