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 2.7] Type of annotated prop not recognized in the component #2347
Labels
Comments
I guess the example is needlessly complicated. It could even not have any JSDoc annotation probably and would still reproduce. |
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),
};
},
}) |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: