Skip to content
masterclass Buddy

Vue.js · Function

onUnmounted

onUnmounted() registers a callback that runs after a component is unmounted. Use it to clean up manually created side effects such as timers, event listeners, and server connections.

Last updated

Syntax

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

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

Subscribe
  • onMounted()
  • onBeforeUnmount()
  • onBeforeMount()
  • onBeforeUpdate()
  • onUpdated()

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