Skip to content
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

?component param needed to get correct in-editor typing #134

Open
beefchimi opened this issue Nov 23, 2023 · 1 comment
Open

?component param needed to get correct in-editor typing #134

beefchimi opened this issue Nov 23, 2023 · 1 comment

Comments

@beefchimi
Copy link

Without the ?component param at the end of the .svg import, VsCode reports the import as a string.

Only by appending the ?component will VsCode report it as a FunctionalComponent:

import

I tried adding defaultImport: 'component' to the svgLoader config and it made no difference.

@microHoffman
Copy link

Yeah I have similar issue, I've resolved that by manually putting this to my index.d.ts:

declare module '*.svg' {
    import type { FunctionalComponent, SVGAttributes } from 'vue'
    const src: FunctionalComponent<SVGAttributes>
    export default src
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants