vite-svg-loader
vite-svg-loader copied to clipboard
`?component` param needed to get correct in-editor typing
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:
I tried adding defaultImport: 'component' to the svgLoader config and it made no difference.
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
}