父子组件挂载顺序
父: beforeCreate => 父: created => 父: beforeMount => 子: beforeCreate => 子: created => 子:beforeMount => 子:mounted => 父: mounted
更新过程(父组件自己)
父:beforeUpdate => 父: updated
更新过程(影响子组件)
父:beforeUpdate => 子: beforeUpdate => 子: updated => 父: updated
销毁
父: beforeDestroy => 子:beforeDestroy => 子 : destroyed=> 父 :destroyed
Question
mounted拿到数据可以后可以直接获取dom吗?
我的想法是 created想拿到dom需要nexttick,但是我们有时候使用echarts的时候也需要在mounted使用nexttick,原因是因为 父组件无法保证子组件已经挂载完成
参考
- https://cn.vuejs.org/v2/api/#mounted