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

vue-tsc removing comments in defineProps when used with withDefaults #703

Closed
soulsam480 opened this issue Nov 16, 2021 · 2 comments
Closed
Labels

Comments

@soulsam480
Copy link

hii @johnsoncodehk , I noticed it today that when I use vue-tsc to emit declarations for vue components, it doesn't remove comments when the props are declared without withDefaults. When I wrap defineProps inside withDefaults it removes comments.

steps to reproduce

Let me know if you need more clarity.

@johnsoncodehk
Copy link
Member

I think TS can't keep props comments in this situation. You can try to build the vanilla TS script:

// foo.ts
export default defineComponent({
  props: {
    /**
     * a foo
     */
    foo: String
  }
})

@johnsoncodehk
Copy link
Member

Fixed by vuejs/core#5871.

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

No branches or pull requests

2 participants