Skip to content

[Vue 2.7] Type of annotated prop not recognized in the component #2347

@rchl

Description

@rchl

Repro:

Repository: https://github.com/rchl/volar-vue2-test (pages/typeless.vue file)

<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;
    };
}

Expected

The type of this.tracks is correctly reported as Track[]

Actual

Screenshot 2023-01-30 at 23 10 41

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy