WebStorm无法识别@下的文件,但是可以正常使用

报错过程


相关文件

routes.ts:

ts 复制代码
import type {RouteRecordRaw} from "vue-router";  
  
const routes: RouteRecordRaw[] = [  
    {  
        path: '/',  
        name: 'index',  
        component: () => import('@/pages/Index.vue')  
    }  
]  
  
export default routes

vite.config.ts

ts 复制代码
import {defineConfig} from 'vite'  
import vue from '@vitejs/plugin-vue'  
import Components from 'unplugin-vue-components/vite';  
import { VantResolver } from 'unplugin-vue-components/resolvers';  
import path from 'path'  
  
// https://vite.dev/config/  
export default defineConfig({  
    plugins: [  
        vue(),  
        Components({resolvers: [VantResolver()]})  
    ],  
    resolve: {  
        alias: {  
            '@': path.resolve(__dirname, './src')  
        }  
    }  
})

tsconfig.json

json 复制代码
{  
  "files": [],  
  "references": [  
    { "path": "./tsconfig.app.json" },  
    { "path": "./tsconfig.node.json" }  
  ],  
  "compilerOptions": {  
    "baseUrl": "./",  
    "paths": {  
      "@/*": ["src/*"]  
    }  
  },  
  "exclude": ["node_modules", "dist"]  
}

报错解决


tsconfig.json添加:

json 复制代码
{  
...
  "compilerOptions": {  
  ...
  },  
  "include": ["src/**/*"],  
  ...
}
相关推荐
weixin_5633714715 小时前
Android Studio 2024 版 Device Explorer 打开方法
android·ide·android studio
咸咸咸虾16 小时前
Microsoft Visual Studio 历史版本与官方安装包链接汇总
ide·microsoft·visual studio
芝士爱沙拉19 小时前
原生内置agent智能开发能力的MCU IDE-MounRiver Studio
ide·单片机·嵌入式硬件
2501_915909061 天前
Windows 上用 VS Code 调试 iPhone 真机 App,KXBuild 断点、崩溃定位实操
ide·windows·vscode·ios·iphone·个人开发·敏捷流程
小卡拉米本米1 天前
解决Vscode使用GitHub账号登录慢的问题
ide·vscode·编辑器
2601_967987371 天前
终端 IDE 卷到了新高度:个人免费,符号索引快 65%,内存省 95%
ide·python·免费·性能·rune
1024奇点2 天前
【仓颉语言入门 · 第二篇 第 12 课】
开发语言·数据库·ide·mysql·开源
weixin_399380692 天前
TongWeb7.0.4.9M11如何接入到idea(by lqw)
java·ide·intellij-idea
_小许_3 天前
AI IDE 与 Agent Harness:一次说清 Cursor、Codex 该怎么选
ide·人工智能·ai编程·cursor·codex
喆星时瑜3 天前
探索 Anaconda 中的 JupyterLab、Jupyter Notebook、iPython 解释器(Qt 控制台)和 Spyder IDE
ide·jupyter·ipython