Reactivity (ref, reactive)

Vue's reactivity automatically updates the interface when data changes. ref() wraps a value, accessible through .value in the script, and reactive() makes an object reactive. Vue tracks dependencies during rendering and recomputes only what is affected.

Example

import { ref } from 'vue'
const compteur = ref(0)
compteur.value++

Related concepts

The whole glossary