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/**/*"],  
  ...
}
相关推荐
love530love20 小时前
EPGF架构:Python开发的长效稳定之道
开发语言·ide·人工智能·windows·python·架构·pycharm
weixin_448119941 天前
在vscode中,在powershell 下,如何进入子目录?
前端·ide·vscode
万粉变现经纪人1 天前
如何解决 pip install 安装报错 ModuleNotFoundError: No module named ‘django’ 问题
ide·后端·python·django·beautifulsoup·pandas·pip
可能是猫猫人1 天前
Pycharm中切换虚拟环境
ide·python·pycharm
sibylyue1 天前
IDEA cannot resolve method
java·ide·intellij-idea
张人玉2 天前
如何使用AI IDE书写Vue3数据可视化大屏项目
ide·人工智能·信息可视化
小蕾Java2 天前
Python开发最新 PyCharm 2025使用(附详细教程)
ide·python·pycharm
liu_endong2 天前
vscode关闭coplit功能
ide·vscode·编辑器
背太阳的牧羊人2 天前
vscode在断点旁边写expression让条件为true的时候才触发断点提高调试效率
ide·vscode·编辑器
笨笨D幸福2 天前
vscode clangd 保姆教程
ide·vscode·clangd