父子组件的生命周期钩子 面试题(6)

父子组件的生命周期钩子

1.创建阶段

beforeCreated(父)---------------->Created(父)------------------->beforeCreated(子)--------------------->Created(子)----------------Mounted(子)-----------------Mounted(父)

2.加载渲染

beforeCreated(父)--------------->Created(父)------------------>beforeMounted(父)

beforeCreated(子)--------------->Created(子)------------------>beforeMounted(子)

Mounted(子)-----------------Mounted(父)

3.更新过程

beforeUpdated(父)------------------->beforeUpdated(子)----------------updated(子)----------updated(父)

4.销毁过程

beforeDestory(父)-----------beforeDestory(子)-----------------destoryed(子)---------------destoryed(父)

猜你喜欢

转载自blog.csdn.net/qq_59076775/article/details/122119794