Vue生命周期函数及其调用顺序总结
Vue生命周期函数是Vue实例从创建、挂载、更新和销毁的过程中所执行的一系列钩子函数。从创建开始,依次为beforeCreate、created、beforeMount、mounted、beforeUpdate、updated、beforeDestroy、destroyed。在组件中还有activated和deactivated。在生命周期函数中可以进行数据的初始化、获取dom元素等操作。调用顺序为:beforeCreate->created->beforeMount->mounted->beforeUpdate->updated。
下载地址
用户评论