iview-weapp 有个key的选项,会编译为wx:key,如何让它不编译
<i-tabs current={current} color='#f759ab' onChange={this.handleChange}>
<i-tab key='now' title='接单中'></i-tab>
<i-tab key='in' title='上门中'></i-tab>
<i-tab key='succ' title='已完成'></i-tab>
</i-tabs>
fix
换taro-ui吧
<wux-tabs className='tabs' auto current={current} onChange={this.onChange.bind(this)}>
{tabItems.map((item, index) => {
return <wux-tab key={item.id} tab_key={item.id} title={item.title} />
})}
</wux-tabs>
<wux-refresher id='wux-refresher' onRefresh={this.onRefresh.bind(this)} className='container'>
这看起来不是很好的解决方案, 我的第三方组件不能正常运行 比如className key onChange属性都直接跳过了, 不能生成onChange事件。taro-ui的话 没有下拉刷新 小程序自带的没有动画
最新 beta 版本应该已经不会编译成 wx:key 了
@luckyadam 确实最新版已经忽略了第三方组件的key及事件的处理, 但却造成所有的第三方组件不能响应事件了,比如我上面的onChange事件 就算我修改成bindonchang $$event中也没有生成onChange 是为了平台统一么,另外0b4d7ce的修改导致className -> class 只作用于默认组件了
@Qiu800820 https://github.com/NervJS/taro/commit/4b7249672cc88298e8ee79c3a9d1be7f59eca555 的确有问题,应该改成只作用于 key。修复在 https://github.com/NervJS/taro/commit/2920f335c4ee8622237a15d75bc98ce47744b1e0
https://github.com/NervJS/taro/commit/0b4d7ce63f68297f70db179e95162bf39737f4b0 应该是对的,自定义组件的 props 就应该是你写什么就是什么