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

不能传递事件? #215

Closed
NoahSun opened this issue Jun 27, 2018 · 4 comments
Closed

不能传递事件? #215

NoahSun opened this issue Jun 27, 2018 · 4 comments

Comments

@NoahSun
Copy link

NoahSun commented Jun 27, 2018

image

image

image

image

@crper
Copy link

crper commented Jun 27, 2018

可以查阅下 官方文档做出的妥协 : https://github.com/NervJS/taro/blob/master/docs/event.md

字体还有个性,啥字体?

@NoahSun
Copy link
Author

NoahSun commented Jun 27, 2018

@crper 我的handleClearValue是写在SearchBar组件里面的,然后想把handleClearValue传递给FontIcon来执行,但是他提示我的是 Do not have onClick handler in current page: pages/index/index. Please make sure that onClick handler has been defined in pages/index/index, or pages/index/index has been added into app.json ,这个错误跟文档说的妥协搭边吗?

@luckyadam
Copy link
Member

这是个bug,正在处理,先这样包一层调用

export default class FontIcon extends Componet<IProps> {
  onClickHandler = () => {
    this.props.onClick()
  }
  return (
    <Text onClick={this.onClickHandler} />
  )
}

@luckyadam
Copy link
Member

最新的 beta 版本修复了这个问题~

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

3 participants