Closed wenfangdu closed 1 year ago
This indeed prevents types from properly showing up in my setup (quite standard, Vue3, up to date Vue language extensions, TS5 but just like #640 I am also using unplugin-auto-import). https://github.com/vuejs/router even has a TODO in their code asking why it is not working with 'vue' (I do not have the answer). https://github.com/vuejs/router/blob/c396d14b57be0da1e3504856e89d282f0666242f/packages/router/src/globalExtensions.ts#L11-L12
Solution so far as to lock to version "0.25.0".
This indeed prevents types from properly showing up in my setup (quite standard, Vue3, up to date Vue language extensions, TS5 but just like #640 I am also using unplugin-auto-import). https://github.com/vuejs/router even has a TODO in their code asking why it is not working with 'vue' (I do not have the answer). https://github.com/vuejs/router/blob/c396d14b57be0da1e3504856e89d282f0666242f/packages/router/src/globalExtensions.ts#L11-L12
Solution so far as to lock to version "0.25.0".
I also encountered the same problem, which took me a lot of time to troubleshoot. I suggest adding an option to control whether to use 'vue' or '@vue/runtime-core'
Description
Since many projects don't have
@vue/runtime-core
installed (pnpm projects in particular), the types generated byunplugin-vue-components
won't work. Vue projects do havevue
installed and augmentingvue
itself is enough to get the types to work with Volar.Linked Issues
Fixes https://github.com/vuejs/language-tools/issues/3107 Fixes https://github.com/antfu/unplugin-vue-components/issues/355 Fixes https://github.com/antfu/unplugin-vue-components/issues/635