sampullman / vite-plugin-vue-images

Auto import images for Vite+Vue projects
MIT License
11 stars 2 forks source link

Fix Typescript issues with Vetur #1

Open sampullman opened 3 years ago

sampullman commented 3 years ago

In a Vue3/Typescript project, Vetur (VSCode) shows the following error when using this plugin:

Property 'VueLogo' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<({} & (Readonly<{} & {} & {}> & ({} | {}))) & (VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly<...> & ({} | {})), never>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...> | undefined...'.

Tasks

sampullman commented 3 years ago

vite-plugin-components supports this with Volar, their solution can be investigated investigated: https://github.com/antfu/vite-plugin-components#typescript

General support may rely on: https://github.com/vuejs/vue-next/pull/3399