Closed qq61966100 closed 1 week ago
试过在"typeRoots": ["./node_modules/@types/", "./types"] 中加入 “。/node_modules”, tsconfig不报错了,但是.vue文件中还是不显示类型定义
请提供最小重现。大概率是由于你没有生成自动导入dts。
If you are using pnpm, See https://github.com/vuejs/language-tools/issues/4401#issuecomment-2128053146
请提供最小重现。大概率是由于你没有生成自动导入dts。
抱歉我的问题,使用了自动导入,但是auto-components.d.ts报错了,导致无法识别,不过我看这个项目的tsconfig中提示报错,说element-plus/global找不到,但是项目又能看正常的类型定义,不知道为啥?
If you are using pnpm, See #4401 (comment)
Thanks, am using pnpm, but they are not same issue, i found the reason, but really appreciate for your response.
My fault, thank you all, it caused by auto-components.d.ts. close it as no fixing is needed.
Vue - Official extension or vue-tsc version
Vue - Official
VSCode version
1.90.1
Vue version
3
TypeScript version
5.3.3
System Info
No response
Steps to reproduce
我导入了一个Vue3 vite element-plus项目,但是element-plus的组件在.vue文件中不提示类型定义,都是蓝色,别人用另外的工具导入同样的项目可以显示类型定义,这是怎么回事?
![image](https://github.com/vuejs/language-tools/assets/15924518/01dc1e4d-a6a0-457d-bd62-3782d20fb279)
Link to minimal reproduction
No response
Any additional comments?
No response