Skip to main content

生命周期

options API 2.xoptions API 3.xcomposition APISetup API
组件创建前beforeCreatebeforeCreatesetup()setup()
组件创建后createdcreatedsetup()setup()
组件挂载前beforeMountbeforeMountonBeforeMount
组件挂载后mountedmountedonMounted
数据更新前beforeUpdatebeforeUpdateonBeforeUpdate
数据更新后updatedupdatedonUpdated
组件销毁前beforeDestroybeforeUnmountonBeforeUnmount
组件销毁后destroyedunmountedonUnmounted
errorCapturederrorCapturedonErrorCaptured
renderTrackedonRenderTracked
renderTriggeredonRenderTriggered
keep-aliveactivatedonActivated
keep-alivedeactivatedonDeactivated