megalo icon indicating copy to clipboard operation
megalo copied to clipboard

mounted钩子执行顺序问题

Open zhanghaoxu opened this issue 4 years ago • 0 comments

版本信息: "@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

zhanghaoxu avatar Nov 05 '19 00:11 zhanghaoxu