Skip to content
masterclass Buddy

Vue.js · Function

onBeforeUnmount

onBeforeUnmount() registers a callback that Vue runs just before a component is unmounted. The component is still fully functional at that time.

Last updated

Syntax

function onBeforeUnmount(callback: () => void, target?: ComponentInternalInstance | null): void

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • onMounted
  • onUnmounted
  • onBeforeUpdate
  • onUpdated

Source: Composition API: Lifecycle Hooks | Vue.js. Checked 2026-11-03.