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

页面会被created执行多次 #68

Open
lifetin opened this issue Dec 14, 2018 · 1 comment
Open

页面会被created执行多次 #68

lifetin opened this issue Dec 14, 2018 · 1 comment

Comments

@lifetin
Copy link

lifetin commented Dec 14, 2018

目前我页面导航是这样的,看下图
44

我进来网站后,依次点击1,2,3,4
当到4时,这个页面会执行4次, 如果我跳过4,进入5,再进4,他会执行5次.打印了alert和console,一直是这样
我把这个组件去掉就正常了.
调了几个小时才找出来问题,可能是用了bus引起的.

另外我网上查了下,这个bus还引起了其它问题,
就是我执行,1,2,3,5, 在第5的时候,会把4给执行了created,此时我4页面,还没有创建,没有点击过.

这个组件很好用,只是发现这个问题还希望给优化下.
别人有没有发现这个问题我不知道,我是把每个页面created都console出来做记录才发现的.

然后还提个建议,在页面刷新的时候,能否把那个VUE_NAVIGATION缓存中清除呢

@lifetin
Copy link
Author

lifetin commented Dec 14, 2018

关于bus问题可以看看这个文章
https://www.jianshu.com/p/fde85549e3b0

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

1 participant