Skip to content
New issue

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

taro编译H5,SwiperItem onClick无效 #2127

Closed
pamler opened this issue Feb 11, 2019 · 5 comments
Closed

taro编译H5,SwiperItem onClick无效 #2127

pamler opened this issue Feb 11, 2019 · 5 comments
Assignees

Comments

@pamler
Copy link
Contributor

pamler commented Feb 11, 2019

问题描述
taro编译H5,SwiperItem组件上添加onClick无效,在微信小程序中可以

复现步骤

import Taro, { Component } from '@tarojs/taro'
// 引入 Swiper, SwiperItem 组件
import { Swiper, SwiperItem } from '@tarojs/components'

class App extends Components {

  onPrintLog() {
    console.log('111')
  }

  render () {
    return (
      <Swiper
        className='test-h'
        indicatorColor='#999'
        indicatorActiveColor='#333'
        vertical
        circular
        indicatorDots
        autoplay>
        <SwiperItem onClick={this.onPrintLog}>
          <View className='demo-text-1'>1</View>
        </SwiperItem>
        <SwiperItem>
          <View className='demo-text-2'>2</View>
        </SwiperItem>
        <SwiperItem>
          <View className='demo-text-3'>3</View>
        </SwiperItem>
      </Swiper>
    )
  }
}

系统信息
@tarojs/components: v1.2.12

@taro-bot
Copy link

taro-bot bot commented Feb 11, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented Feb 12, 2019

CC @Littly

@taro-bot
Copy link

taro-bot bot commented Feb 12, 2019

CC @jinjinjin0731

@vvenv
Copy link

vvenv commented Jul 16, 2019

先绑定到 SwiperItem 的子节点上

@ZakaryCode
Copy link
Contributor

same as #3230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants