Skip to content
Level 4 of 7 · watch, onBeforeUpdate, onUpdated and nextTick

A click updates the page

count changes. A watcher, the update hooks and a nextTick callback all react. One card never fires again.

What happensApp is on the page showing count. The learner clicks +1.
App.vue
const count = ref(0)
watch(count, () => log('watch'))
function add() {
  count.value++
  nextTick(() => log('next tick'))
}
Deck · tap a card to add it, or drag it into place
Timeline · first to last
  1. Next card