Subscribe on changes!

the bug is about 'context' or 'v-model'

avatar
Oct 18th 2020

Version

3.0.1

Reproduction link

https://codesandbox.io/s/vigorous-glade-cn59t?file=/src/components/Test.vue

Steps to reproduce

it's a problem about v-model. in a component I defined this : <input :value="modelValue" @input="updateValue"> in setup I defined this: const updateValue = (e: KeyboardEvent) => { context.emit('update: modelValue', (e.target as HTMLInputElement).value) } but it doesn't work. I test something, maybe the 'context' can not emit this event.

What is expected?

I need realize 'v-model' in a component

What is actually happening?

the event can not emit


I change this way to emit this event and it can work: <input :value="modelValue" @input="$emit('update: modelValue', e.target.value)">

avatar
Oct 18th 2020

update: modelValue => update:modelValue no space