Skip to content
masterclass Buddy

Vue.js · Function

onBeforeMount

onBeforeMount() runs before Vue creates a component's DOM. onMounted() runs after the component DOM and its synchronous children are mounted.

Last updated

Syntax

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

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

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

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