Vue.js · Function
defineModel
defineModel() is a Vue 3.4+ <script setup> macro for component v-model. It gives the child a ref that reads and updates the parent's bound value.
Last updated
- Since
- 3.4
Syntax
const model = defineModel<T>(options?)
const namedModel = defineModel<T>('name', options?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
useModel()v-model modifiersmodelValueupdate:modelValuev-model arguments