SFC generics - cannot use generic prop as object key in template without `props`
Vue version
3.2.45
Link to minimal reproduction
https://github.com/cohlar/vue-rfc436/tree/prop_object_key_error
Steps to reproduce
- Open in IDE with
volar
enabled or runvue-tsc
(tested with versions1.0.9
to1.4.3
) TheWelcome
component should show TS errors
What is expected?
Props defined with defineProps
should be available in the template without the need to use const props = defineProps<...>()
and props.
before the prop name.
What is actually happening?
We must use const props = defineProps<...>()
in the script and props.
before the prop name in the template to get no error.
System Info
No response
Any additional comments?
This issue was initially raised in the volar repo and @johnsoncodehk proposed a "naive" solution.
FYI the fix proposed here doesn't pass the dts tests in core.