Open suukii opened 4 years ago
总共分为 8 个
创建前后 (beforeCreate, created)
挂载前后 (beforeMount, mounted)
$el
data
data.message
更新前后 (beforeUpdate, updated):
销毁前后 (beforeDestroy, destroyed):
destroy
总共分为 8 个
创建前后 (beforeCreate, created)
挂载前后 (beforeMount, mounted)
$el
和data
都已经初始化了,但还是虚拟 DOM 节点,模板中的data.message
还未替换。data.message
成功渲染。更新前后 (beforeUpdate, updated):
data
发生变化时会触发这两个生命周期函数销毁前后 (beforeDestroy, destroyed):
destroy
方法之后,对data
的修改不会再触发生命周期函数,此时 VUE 实例已经解除了事件监听和 DOM 绑定,但 DOM 结构依然存在。