vue2生命周期函数钩子函数
(1)实例创建前,这时还没有dom
deforeCreate
created
(2)dom创建
beforeMount
mounted
(3)更新前
beforeUpdate
updated
(4)销毁前
deforeDestoey
destroyed
Vue3生命周期钩子函数
setup创建实例前
onBeforeMount挂载DOM前
onMounted挂载DOM后
onBeforeUpdate更新组件前
onUpdated更新组件后
onBeforeUnmount卸载销毁前
onUnmounted卸载销毁后