We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Repository: https://github.com/rchl/volar-vue2-test (pages/typeless.vue file)
pages/typeless.vue
<template> <div>noop</div> </template> <script> export default { props: { tracks: { /** @type {import('vue').PropType<MyNamespace.Track[]>} */ type: Array, required: true, }, }, data() { return { inputs: this.tracks.map(track => track), }; }, }; </script>
declare namespace MyNamespace { type Track = { id: number; title: string; }; }
The type of this.tracks is correctly reported as Track[]
this.tracks
Track[]
The text was updated successfully, but these errors were encountered:
I guess the example is needlessly complicated. It could even not have any JSDoc annotation probably and would still reproduce.
Sorry, something went wrong.
Or is it about JSDoc just not working in this context?
This TS file seems to work:
import { defineComponent, PropType } from 'vue' export default defineComponent({ props: { tracks: { type: Array as PropType<string[]>, required: true, }, }, data() { return { inputs: this.tracks.map(track => track), }; }, })
but not this JS file:
import { defineComponent } from 'vue' export default defineComponent({ props: { tracks: { /** @type {import('vue').PropType<string[]>} */ type: Array, required: true, }, }, data() { return { inputs: this.tracks.map(track => track), }; }, })
vuejs/vue#13063
No branches or pull requests
Repro:
Repository: https://github.com/rchl/volar-vue2-test (
pages/typeless.vue
file)Expected
The type of
this.tracks
is correctly reported asTrack[]
Actual
The text was updated successfully, but these errors were encountered: