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

feat(runtime): 普通组件可以通过 eventCenter 触发页面组件的 onReady 事件 #6221

Merged
merged 1 commit into from
May 7, 2020

Conversation

yuche
Copy link
Contributor

@yuche yuche commented May 6, 2020

形如以下代码:

class Test extends React.Component {
  componentDidMount () {
    Taro.eventCenter.once(Taro.Current.router.onReady, () => {
      const query = Taro.createSelectorQuery()
      query.select('#only').boundingClientRect()
      query.exec(res => {
        console.log(res, 'res')
      })
      console.log('onReady')
    })
  }

  render () {
    return (
      <View id="only">
      </View>
    )
  }
}

@sunflower8th
Copy link

监听回调,并没有执行????

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

Successfully merging this pull request may close these issues.

3 participants