docs icon indicating copy to clipboard operation
docs copied to clipboard

TS Composition API: Mention explicit PropType on prop runtime declaration

Open julian-eckhardt opened this issue 3 years ago • 2 comments

Description of Problem

Right now, the guide does not mention a way to have explicit prop type declarations and default values at the same time. The only (close) solution, Reactivity Transform, is experimental and opt-in.

Proposed Solution

Mentioning the as PropType <Foo> syntax, as in this PR.

Additional Information

I'm filing this PR not only to contribute to the docs and hopefully help others, but also to verify my own approach on the problem. I'd be keen on maintainers' input on this.

julian-eckhardt avatar Jul 29 '22 12:07 julian-eckhardt

Deploy Preview for vuejs ready!

Name Link
Latest commit c09466b7a479672a3768b0d31415ed19a169f3ad
Latest deploy log https://app.netlify.com/sites/vuejs/deploys/62e90e6f302c8b0008306b7c
Deploy Preview https://deploy-preview-1868--vuejs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jul 29 '22 12:07 netlify[bot]

There is a related issue for this: https://github.com/vuejs/docs/issues/1621.

skirtles-code avatar Jul 30 '22 13:07 skirtles-code

I gave this some more thought and decided it might be better to take a slightly different approach to documenting this. There are more details on #1621, which has now been merged.

I'm going to close this PR, but if anyone has any further thoughts on this topic then feel free to share them on #1621 or open a new issue.

Thanks.

skirtles-code avatar Jan 12 '23 15:01 skirtles-code