Skip to content
Level 1 of 7 · setup, watchEffect, onBeforeMount and onMounted

One component mounts

The page loads. In which order do setup, a watchEffect and the two mount hooks run?

What happensThe page loads and App mounts.
App.vue
const count = ref(0)
watchEffect(() => console.log(count.value))
onBeforeMount(() => log('before mount'))
onMounted(() => log('mounted'))
Deck · tap a card to add it, or drag it into place
Timeline · first to last
  1. Next card