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生命周期钩子 #5

Open
MaMaFish opened this issue Mar 1, 2020 · 0 comments
Open

Vue生命周期钩子 #5

MaMaFish opened this issue Mar 1, 2020 · 0 comments

Comments

@MaMaFish
Copy link
Owner

MaMaFish commented Mar 1, 2020

  • beforeCreate:组件实例被创建之初,组件的属性生效之前。
  • created:组件实例已经完全创建,data和methods都已经初始化完成,但真实 dom 还没有生成,$el 还不可用。
  • beforeMount:在挂载开始之前被调用,相关的 render 函数首次被调用。
  • mounted:el 被新创建的 vm.$el 替换,将内存中编译好的模板真实替换到页面中去,并挂载到实例上。
  • beforeUpdate:组件数据更新之前调用,data是新的,页面上还是显示的老数据。
  • updated:组件数据更新之后,data和页面保持一致。
  • activited:keep-alive 专属,组件被激活时调用。
  • deactivated:keep-alive 专属,组件被移除时调用。
  • beforeDestory:组件销毁前调用。
  • destoryed:组件销毁后调用。
@MaMaFish MaMaFish changed the title 第5题:Vue生命周期函数 第5题:Vue生命周期钩子 Mar 1, 2020
@MaMaFish MaMaFish changed the title 第5题:Vue生命周期钩子 Vue生命周期钩子 Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant