Skip to content

vue2生命周期执行顺序回顾

vue2vue3-Options APIvue3-Composition API
beforeCreatebeforeCreatesetup
createdcreated
beforeMountbeforeMountonBeforeMount
mountedmountedonMounted
beforeUpdatebeforeUpdateonBeforeUpdate
updatedupdatedonUpdated
beforeDestroyonBeforeUnmount
destroyedonUnmounted
onActivated
onDeactivated
onErrorCaptured
onRenderTracked
onRenderTriggered