三毛笔记

Vue生命周期函数(钩子函数)

Vue生命周期过程中,会自动运行一些函数,被称为生命周期钩子,让开发者可以在特定阶段运行自己的代码。

创建阶段(准备数据)

beforeCreate()、created()

挂载前阶段(渲染模板)

beforeMount()、mounted()

更新阶段

beforeUpdate()、updated()

卸载阶段

beforeDestroy()、destroyed()

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »