Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ly2011 opened this issue May 21, 2019 · 2 comments
Open

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

ly2011 opened this issue May 21, 2019 · 2 comments
Labels

Comments

@ly2011
Copy link
Owner

ly2011 commented May 21, 2019

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

@ly2011 ly2011 added the Vue label May 21, 2019
@gaoyafengyagao
Copy link

父beforeCreate->父Created->父beforeMount->子beforeCreate->子created->子beforeMount->子mounted->父mounted->

父beforeUpdate->子beforeUpdate->子update->父update

父beforeDestroy->子beforeDestory->子destroyed->父destroyed

@ly2011
Copy link
Owner Author

ly2011 commented Jul 4, 2019

  1. 加载渲染过程
    父beforeCreate->父created->父beforeMount->子beforeCreate->子created->子beforeMount->子mounted->父mounted
  2. 子组件更新过程
    父beforeUpdate->子beforeUpdate->子updated->父updated
  3. 父组件更新过程
    父beforeUpdate->父updated
  4. 销毁过程
    父beforeDestroy->子beforeDestroy->子destroyed->父destroyed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants