taro icon indicating copy to clipboard operation
taro copied to clipboard

在循环中组件通过函数创建 ref 函数不执行 taro版本《1.2.0-beta.7》

Open chenkefeng opened this issue 8 years ago • 4 comments

问题描述 tarocli 版本1.2.0-beta.7 在循环中 通过函数创建ref时 ref函数不执行

复现步骤

render () {
    
    return (
      <SDBody sd-class='container'>
        <View className='cell-list'>
          {
            [1,2,3,4,5,6,7,8,9,10].map((item, index) => {
              return (
                <View className='cell-item' key={index}>
                  <SDSlide id={`comps_${index}`} name={`comps_${item}`} ref={this.getSlideRef} slideWidth={150} height={200} extData={index}
                           renderSlide={
                             <View className='cell-right'>删除</View>
                           }
                           onWillEditing={this.cellWillEditing.bind(this, item)}>
                    AAA
                  </SDSlide>
                </View>
              )
            })
          }
        </View>
      </SDBody>
    )
 }
getSlideRef = (node) => {
    console.log(node.props, node, '========')
}

系统信息

  • 操作系统: [macOS mojave]
  • Taro 版本 [v.1.2.0-bate.7]
  • Node.js 版本 [v11.2.0]
  • 报错平台 [ weapp]

chenkefeng avatar Dec 06 '18 06:12 chenkefeng

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-bot[bot] avatar Dec 06 '18 06:12 taro-bot[bot]

CC @yuche

taro-bot[bot] avatar Dec 06 '18 08:12 taro-bot[bot]

这个bug 修复了吗?感觉1.3.0还是不行啊

guziyu001 avatar Jun 26 '19 14:06 guziyu001

@yuche

guziyu001 avatar Jun 26 '19 14:06 guziyu001