Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modelValue required prop warning despite usage of v-model #2647

Closed
4 tasks done
Akryum opened this issue Jan 25, 2021 · 4 comments · Fixed by #2688
Closed
4 tasks done

modelValue required prop warning despite usage of v-model #2647

Akryum opened this issue Jan 25, 2021 · 4 comments · Fixed by #2688
Labels

Comments

@Akryum
Copy link
Member

Akryum commented Jan 25, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Linux
  • Vetur version: 0.32.0
  • VS Code version: 1.52.1

Problem

The modelValue prop is marked as required in my BaseInput component. Despite using the v-model directive, Vetur displays an error that modelValue is required and isn't used:

image

Reproducible Case

TODO

@yoyo930021
Copy link
Member

yoyo930021 commented Jan 26, 2021

Do your BaseInput component have model property in script?

@Blackfaded
Copy link

Blackfaded commented Feb 26, 2021

I am facing the same issue:

Bildschirmfoto 2021-02-26 um 12 09 12
Bildschirmfoto 2021-02-26 um 12 09 31

@muodov
Copy link

muodov commented Jul 7, 2021

@yoyo930021

This is still a problem when a component defines both "value" and "modelValue" props. If I read the code correctly, the problem is coming from this line: https://github.com/vuejs/vetur/blame/78171ae446a71982708556b3950f08cc4dd0bd01/server/src/modes/script/componentInfo.ts#L342

I would make a PR, but don't have much time atm, hopefully someone can pick it up

@mariomadrigall205
Copy link

Algúnos años después, pero por si alguién tiene el problema. Esto se soluciona simplemente añadiendo el v-model="" de primer propiedad en la etiqueta que se este trabajando.

Saludos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants