Subscribe on changes!

Warn if parent component tries to bind a prop using `v-model:xxx` but the child component doesn't declare a prop named `xxx`

avatar
Aug 27th 2020

What problem does this feature solve?

All vue2 repos uses v-model for 2-way bindings, but vue3 changed the default prop to bind of v-model. Generating a warning with undesired v-model usage will greatly simplify the migration of 2-3

What does the proposed API look like?

N/A

avatar
Sep 1st 2020

Can you provide a reproduction link? In this way, others can help you better 😁

avatar
Sep 1st 2020

I believe in Vue 3 prop declarations are optional.

avatar
Sep 2nd 2020

Can you provide a reproduction link? In this way, others can help you better 😁

Here it is: https://jsfiddle.net/j1h8z9cb/1/

avatar
Sep 2nd 2020

I believe in Vue 3 prop declarations are optional.

  1. For functional component: yes.
  2. For normal component: no.
avatar
Sep 14th 2020

We can't warn it in every case since technically you can let v-model generated props fall through to an inner component.

As for making it easier to migrate to the new usage, that belongs to the migration build where we try to provide v2 compatibility and detailed warnings when possible. v-model will definitely be covered since it's a pretty major change.