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

隐藏页面的组件wx:if true的时候会出现ready绑定的store错误 #107

Open
semi-xi opened this issue Mar 20, 2020 · 2 comments
Open

Comments

@semi-xi
Copy link

semi-xi commented Mar 20, 2020

原因是因为在create的时候,执行ready事件绑定的page是当前显示的页面page,但是当前页面有可能并不处于激活状态,这样就导致了

this.page = getCurrentPages()[getCurrentPages().length - 1]
this.store = this.page.store

是个异常

demo:
A页面

A页面的组件 
<a wx:if="{{isShow}}" />

A跳转到B页面,一些状态变更,导致了A页面的a组件show了,但是a组件拿到的是,B的store

是不是可以通过getPageId 拿到页面实例用来判断页面

@huzedong2015
Copy link

我这里也报这个错了
Cannot read property 'data' of undefined
TypeError: Cannot read property 'data' of undefined

@kevinroy-lo
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

No branches or pull requests

3 participants