正在回答 回答被采纳积分+1
2回答
Brian
2025-03-29 11:05:03
你在项目的根目录中打开文件目录,或者使用上面的快捷命令
检察一下上面的typescript的位置有没有报错
修改如下文件tsconfig.app.json:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | { "extends" : "@vue/tsconfig/tsconfig.dom.json" , "include" : [ "env.d.ts" , "src/**/*" , "src/**/*.vue" , "typed-router.d.ts" , "auto-imports.d.ts" , "components.d.ts" ], "exclude" : [ "src/**/__tests__/*" ], "compilerOptions" : { "moduleResolution" : "node" , "noImplicitAny" : false , "composite" : true , "tsBuildInfoFile" : "./node_modules/.tmp/tsconfig.app.tsbuildinfo" , "baseUrl" : "." , "paths" : { "@/*" : [ "./src/*" ] }, "types" : [ "element-plus/global" , "@intlify/unplugin-vue-i18n/messages" ] } } |
修改如下文件tsconfig.node.json:
1 2 3 4 5 6 7 8 9 10 11 12 | { "extends" : "@tsconfig/node22/tsconfig.json" , "include" : [ "vite.config.*" , "vitest.config.*" , "cypress.config.*" , "nightwatch.conf.*" , "playwright.config.*" ], "compilerOptions" : { "composite" : true , "noEmit" : true , "tsBuildInfoFile" : "./node_modules/.tmp/tsconfig.node.tsbuildinfo" , "module" : "ESNext" , "moduleResolution" : "Node" , "types" : [ "node" ] } |
使用pnpm run dev
然后重启扩展宿主,即可
前端高级工程师(大前端)
- 参与学习 307 人
- 解答问题 395 个
全新打造“技术成长&职业破局”双高体系,深度打通“全栈 + 全流程 +多端+ 提效+AI赋能”,递进式锤炼思维与高阶技能,高效实现能力跃迁,助力成为“驾驭全局,深广兼备,打通多端全栈”的高级工程师
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧