Skip to content

Template props validation generates kebab-case key with incorrect optional modifier placement #2411

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

Closed
4 tasks done
yyx990803 opened this issue Oct 29, 2020 · 2 comments
Closed
4 tasks done

Comments

@yyx990803
Copy link
Member

yyx990803 commented Oct 29, 2020

  • 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: macOS
  • Vetur version: 0.28.0
  • VS Code version: 1.50.1

Problem

If a component defines optional props in camel case, e.g.

Screen Shot 2020-10-29 at 4 13 03 PM

Then in another component that uses it, the types generated for props validation places the optional modifier ? incorrectly as part of the key:

Screen Shot 2020-10-29 at 4 16 27 PM

The generated type should be

{
  'default-split'?: number
}

not

{
  'default-split?': number
}

Reproducible Case

This can be reproduced on https://github.com/vuejs/vue-devtools/tree/next by opening https://github.com/vuejs/vue-devtools/blob/next/packages/app-frontend/src/features/components/ComponentsInspector.vue and hover over <SplitPane>

@yyx990803 yyx990803 changed the title Template props validation generates incorrect optional key for kebab-case props Template props validation generates kebab-case key with incorrect optional modifier placement Oct 29, 2020
@yoyo930021
Copy link
Member

yoyo930021 commented Oct 30, 2020

Duplicate of #2314

@yoyo930021 yoyo930021 marked this as a duplicate of #2314 Oct 30, 2020
@yoyo930021
Copy link
Member

It will fix in #2342 PR.

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