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

tabs点击事件触发两次 #321

Closed
shaodushu opened this issue Jan 8, 2019 · 1 comment
Closed

tabs点击事件触发两次 #321

shaodushu opened this issue Jan 8, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@shaodushu
Copy link
Contributor

问题描述

点击tabs组件,onClick事件触发两次

代码:
image

小程序效果:
image

复现步骤
如上

期望行为
点击tabs组件,onClick事件触发一次

报错信息

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

👽 Taro v1.2.4

Taro CLI 1.2.4 environment info:
System:
OS: Windows 10
Binaries:
Node: 11.4.0 - D:\nodejs\node.EXE
npm: 6.4.1 - D:\nodejs\npm.CMD

`
taro-ui
image

@shaodushu shaodushu changed the title tabs点击事件重发两次 tabs点击事件触发两次 Jan 8, 2019
@koppthe koppthe added the bug Something isn't working label Jan 8, 2019
@Mrsmarks
Copy link

自己去改源码。componentWillReceiveProps(nextProps) {
if (nextProps.scroll !== this.props.scroll) {
this.getTabHeaderRef();
}
/* if (nextProps.current !== this.state.current) {
this.handleClick(nextProps.current);
} */
}
注释掉就好了

jimczj added a commit that referenced this issue Jan 15, 2019
jimczj added a commit that referenced this issue Jan 15, 2019
* next:
  fix(tabs): 修复二次点击 #321
@jimczj jimczj closed this as completed Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants