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
问题描述 在用map循环出的元素身上绑定的事件无效,无法触发
[或者可以直接贴源代码,能贴文字就不要截图] 源码
navito = (info,e) => { console.log(info) } render () { let list = [1,2,3,4,5,6,7]; return ( <View className='index'> <Button className='add_btn' onClick={this.props.add}>+</Button> <Button className='dec_btn' onClick={this.props.dec}>-</Button> <Button className='dec_btn' onClick={this.props.asyncAdd}>async</Button> <View>{this.props.counter.num}</View> <View>Hello, World</View> <Icon size="20" type="success"/> {list.map((v,i)=>(<view className="viewsc" key={i} onClick={this.navito.bind(this,'循环view')}>{v}</view>))} <Button onClick={this.navito.bind(this,'button')}>button</Button> <View onClick={this.navito.bind(this,'单个view')}>测试事件</View> </View> ) } }
结果截图
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
补充信息 [可选] [根据你的调查研究,出现这个问题的原因可能在哪里?] 看了编译后的代码,onClick并没有编译成bindTap,如下 编译后的代码
<view class="viewsc" wx:key="{{i}}" onClick="navito" wx:for="{{list}}" wx:for-item="v" wx:for-index="i" data-e-navito-so="this" data-e-navito-a-a="循环view" data-component-path="{{$path}}">{{v}}</view>
The text was updated successfully, but these errors were encountered:
发现是自己view写成了小写
Sorry, something went wrong.
No branches or pull requests
问题描述
在用map循环出的元素身上绑定的事件无效,无法触发
[或者可以直接贴源代码,能贴文字就不要截图]
源码
结果截图
报错信息
[这里请贴上你的完整报错截图或文字]
系统信息
补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
看了编译后的代码,onClick并没有编译成bindTap,如下
编译后的代码
The text was updated successfully, but these errors were encountered: