vue 得父子组件和 mixins 生命周期顺序
创建
app-beforeCreate
app-created
app-beforeMount
mixins-beforeCreate
f-beforecreated
mixins-created
f-created
mixins-beforeMount
f-beforeMount
son-beforecreate
son-created
son-beforeMount
son-mounted
mixins-mounted
f-mounted
app-mounted
销毁
mixin-beforeDestroy f-beforeDestroy son-beforeDestroy
son-desctroyed mixin-desctroyed f-desctroyed
选项合并策略
属性
- 对 data 对象进行浅合并(单个属性深合并),在冲突情况下,优先使用组件的 data。
钩子函数
- 钩子函数内部方法冲突,优先使用组件内部方法