TS Composition API: Mention explicit PropType on prop runtime declaration
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.
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
There is a related issue for this: https://github.com/vuejs/docs/issues/1621.
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.