# ❓ Vue 的父组件和子组件生命周期钩子执行顺序是什么

  • 加载过程
|-> `parent`beforeCreate
|-> `parent`created
  |-> `child`beforeMount
  |-> `child`beforeCreate
  |-> `child`created
  |-> `child`beforeMount
  |-> `child`mounted
|-> `parent`mounted
1
2
3
4
5
6
7
8
  • 子组件更新过程
|-> `parent`beforeUpdate
  |-> `child`beforeUpdate
  |-> `child`updated
|-> `parent`updated
1
2
3
4
  • 父组件更新过程
|-> `parent`beforeUpdate
|-> `parent`updated
1
2
  • 销毁过程
|-> `parent`beforeDestroy
  |-> `child`beforeDestroy
  |-> `child`destroyed
|-> `parent`destroyed
1
2
3
4