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

mounted钩子执行顺序问题 #300

Open
zhanghaoxu opened this issue Nov 5, 2019 · 0 comments
Open

mounted钩子执行顺序问题 #300

zhanghaoxu opened this issue Nov 5, 2019 · 0 comments

Comments

@zhanghaoxu
Copy link

版本信息:
"@megalo/api": "0.5.6",
"@megalo/vhtml-plugin": "^0.1.2",
"megalo": "0.10.1",

主要遇到的问题是:
页面级的mounted钩子会最先触发,而页面内组件的mounted钩子是按照vue官方的子先触发,父后触发的顺序,请问这个是megola的特性吗?

实例:
A页面钩子 mounted:()=>{console.log(‘page A mounted’)}
(A页面内组件) component B 钩子 mounted:()=>{console.log(‘component B mounted’)}
组件 component B 子组件C 钩子 mounted:()=>{console.log(‘component C mounted’)}
触发顺序 page A mounted->component C mounted->component B mounted

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