vue2中生命周期
总共11个 常用的8个 前8个
beforeCreate() {
}
created
beforeMount
mounted
beforeUpdate
updated
activated
deactivated
beforeDestroy
destroyed
errorCaptured
vue3中生命周期
选项式
总共14个 常用的8个 前8个
beforeCreate() {
}
created
beforeMount
mounted
beforeUpdate
updated
beforeUnmount
unmounted
errorCaptured
renderTracked
renderTriggered
activated
deactivated
serverPrefetch
组合式
总共12个 常用的6个 前6个
onMounted(()=> {
})
onUpdated()
onUnmounted()
onBeforeMount()
onBeforeUpdate()
onBeforeUnmount()
onErrorCaptured()
onRenderTracked()
onRenderTriggered()
onActivated()
onDeactivated()
onServerPrefetch()