vuejs / docs

📄 Documentation for Vue 3
https://vuejs.org
Other
2.81k stars 4.1k forks source link

Doc for `update:modelValue` or `update:*` event ? #2810

Closed steelywing closed 2 weeks ago

steelywing commented 1 month ago

https://vuejs.org/guide/components/v-model.html#under-the-hood

defineModel will convert to an event named update:modelValue, I search the doc site but I cannot found doc for update:modelValue or update:* event, how the parent handle this event?

I think it will make the parent update the modelValue to the emit value, right?

brc-dd commented 1 month ago

v-model="foo" is compiled to :modelValue="foo" @update:modelValue="$event => (foo = $event)"

steelywing commented 1 month ago

v-model="foo" is compiled to :modelValue="foo" @update:modelValue="$event => (foo = $event)"

Thanks for the quick reply, can we have a doc for this?

brc-dd commented 1 month ago

IIRC it used to be there but I can't find it anymore.

NataliaTepluhina commented 2 weeks ago

Closing as related PR was merged