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

Having both modelValue and value props causes prop type validation error in template #3071

Closed
4 tasks done
SharpSeeEr opened this issue Jul 22, 2021 · 1 comment
Closed
4 tasks done
Assignees
Milestone

Comments

@SharpSeeEr
Copy link

SharpSeeEr commented Jul 22, 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: Windows 10
  • Vetur version: 0.34.1
  • VS Code version: 1.58.2 (user setup)

Problem

When a child component has both a modelValue and a value prop, Vetur incorrectly shows an error:
<Component> misses props: model-value

image

This is referenced by @muodov in this comment on Issue #2647 where he points to this line of code:

https://github.com/vuejs/vetur/blame/78171ae446a71982708556b3950f08cc4dd0bd01/server/src/modes/script/componentInfo.ts#L342

PR #2688 that closed #2647 added a vModelPropName that I believe would need to be applied to line 342 of componentInfo.ts:

const vModelPropName = vueVersion === VueVersion.V30 ? 'modelValue' : 'value';

Reproducible Case

I generated a veturpack project with a component that demonstrates this issue:
https://github.com/SharpSeeEr/vetur-v-model-value-bug

@yoyo930021
Copy link
Member

yoyo930021 commented Aug 6, 2021

It's a bug that comes from a PR.
I will fix it.

@yoyo930021 yoyo930021 self-assigned this Aug 6, 2021
@yoyo930021 yoyo930021 added this to the v0.35.0 milestone Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants