We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果,你在开发过程中,发现event handler 传递参数有问题,例如:代码里使用onClick={this.handleClick.bind(this, 1)}的方式绑定事件处理程序,并且传递值,其定义是
// 方法 handleClick (params , e) { console.log('params:', params) console.log('e:', e) }
// render <View className='flexDirection-c'> <View className='base-width-12 lh-22 tx-c fs-14' onClick={this.handleClick.bind(this, -1)}>全部商品</View> <View className='base-width-12 lh-22 tx-c fs-14' onClick={this.handleClick.bind(this, 0)}>在售商品</View> <View className='lh-22 tx-c fs-14' onClick={this.handleClick.bind(this, 1)}>下架商品</View> </View>
打印结果你如果看到: 而我们所期望的结果是: 这是因为你项目中的taro-cli与依赖的版本不同,升级依赖即可, 项目中必须确保 CLI 和项目依赖是相同版本。
taro-cli
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果,你在开发过程中,发现event handler 传递参数有问题,例如:代码里使用onClick={this.handleClick.bind(this, 1)}的方式绑定事件处理程序,并且传递值,其定义是
打印结果你如果看到:
![在这里插入图片描述](https://camo.githubusercontent.com/750a86b2522555fa3c0b45a13e72b77b0d86388de544b1f45dcd8ba98300377a/68747470733a2f2f696d672d626c6f672e6373646e696d672e636e2f32303139303132313134343832303131302e706e673f782d6f73732d70726f636573733d696d6167652f77617465726d61726b2c747970655f5a6d46755a33706f5a57356e6147567064476b2c736861646f775f31302c746578745f6148523063484d364c7939696247396e4c6d4e7a5a473475626d56304c327831626d466f59576c71615746762c73697a655f31362c636f6c6f725f4646464646462c745f3730)
![在这里插入图片描述](https://camo.githubusercontent.com/3045a51809fc9743248d14057f726adde851bd5c592be7e291a98fcf942ef033/68747470733a2f2f696d672d626c6f672e6373646e696d672e636e2f32303139303132313134353232363735362e706e67)
而我们所期望的结果是:
这是因为你项目中的
taro-cli
与依赖的版本不同,升级依赖即可,项目中必须确保 CLI 和项目依赖是相同版本。
The text was updated successfully, but these errors were encountered: