웹개발/Vue

[Vue3] Lifecycle Hooks(라이프 사이클)

webvillain 2022. 12. 19. 10:25
Options API Composition API  
beforeCreate X (setup)  
created X (setup)  
beforeMount onBeforeMount 렌더링 직전 호출
mounted onMounted 렌더링된 후 호출
beforeUpdate onBeforeUpdate 데이터 변경될 때 호출
updated onUpdated 데이터 변경으로 DOM이 다시 렌더링되고 호출
beforeUnmount onBeforeUnmount Vue객체 제거되기 전 호출
unmounted onUnmounted 컴포넌트가 unmount된 후 호출
errorCaptured onErrorCaptured 자식 컴포넌트 에러 발생될 때 호출
renderTracked onRenderTracked (Dev only)  
renderTriggered onRenderTriggerd (Dev only)  
activated onActivated keep-alive 컴포넌트 활성화될 때 호출
deactivated onDeactivated keep-alive. 컴포넌느 비활성화될 때호출

https://vuejs.org/api/composition-api-lifecycle.html#onerrorcaptured