mounted 执行顺序
来源:5-7 插件的定义和使用

慕少143437
2022-08-03
额,我自己试了一下,打印的是 mixin mixin hello world,暂时没问题了 ~
原问题:老师在 plugin 中加入 app.config.globalProperties.$sayhello = 'hello world'
并且在子组件 mounted 里面打印 $sayhello 后,控制台执行的顺序是 mixin, hello world, mixin. 我就有点奇怪,不是生命周期函数首先执行 mixin 里的,再执行组件里的吗?那应该是 mixin, mixin, hello world 才对呀?难道最后的一个 mixin 是父组件的?
写回答
1回答
-
Dell
2022-08-07
同学你的组建代码发上来我看下,应该是 mixin, mixin, hello world ,我看看怎么回事儿
012022-08-07
相似问题