v-model on a component

v-model on a component creates a two-way binding between the parent and the child. In recent versions of Vue, it relies on defineModel(), or on a modelValue prop and an update:modelValue event. It saves you from writing the prop and the event by hand.

Example

const valeur = defineModel()
// parent: <MonChamp v-model="nom" />

Related concepts

The whole glossary