Subscribe on changes!

Console warning: the child component modifies the properties of the parent component

avatar
Oct 10th 2021

Version

3.2.20

Reproduction link

sfc.vuejs.org/

Steps to reproduce

In review link, enter the value y in the input box on the right, and the result is correct. But the console reports a warning.Such as : [Vue warn]: Component emitted event "update:value" but it is neither declared in the emits option nor as an "onUpdate:value" prop.

image

What is expected?

I follow the document and don't want get a warning in console.

doc such as: https://v3.vuejs.org/guide/migration/v-model.html#_3-x-syntax image

`

What is actually happening?

get a warning in console

avatar
Oct 10th 2021

should be

const emits = defineEmits(['update:value']);