Closed tim-huang closed 2 months ago
Vue 3.4.29 + typescript 5.4 + Vite 5.3.1
tsconfig.json配置
{ "paths": { "@/*": ["./src/*"] } }
vite配置了
export default defineConfig({ plugins: [ vue(), vueDevTools(), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } } })
在ts或vue文件中,使用
@
引用文件:import HelloWorld from '@/components/HelloWorld.vue'
此时在
HelloWorld
上使用gd
可以跳转到正确的文件,但在@/components/HelloWorld.vue
上使用gf
无法跳转到文件。提示: E447: 在路径中找不到文件 "/components/HelloWorld.vue"
gf
is function improved by whick key
, which is support by lsp client. so you must use the real file path to use gf
.
Vue 3.4.29 + typescript 5.4 + Vite 5.3.1 tsconfig.json配置
{ "paths": { "@/*": ["./src/*"] } }
vite配置了
export default defineConfig({ plugins: [ vue(), vueDevTools(), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } } })
在ts或vue文件中,使用
@
引用文件:import HelloWorld from '@/components/HelloWorld.vue'
此时在
HelloWorld
上使用gd
可以跳转到正确的文件,但在@/components/HelloWorld.vue
上使用gf
无法跳转到文件。提示: E447: 在路径中找不到文件 "/components/HelloWorld.vue"
gf
is function improved bywhick key
, which is support by lsp client. so you must use the real file path to usegf
.
Thanks for your quick response, I got it.
Vue 3.4.29 + typescript 5.4 + Vite 5.3.1
tsconfig.json配置
vite配置了
在ts或vue文件中,使用
@
引用文件:此时在
HelloWorld
上使用gd
可以跳转到正确的文件,但在@/components/HelloWorld.vue
上使用gf
无法跳转到文件。提示: E447: 在路径中找不到文件 "/components/HelloWorld.vue"