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/**/*"],  
  ...
}
相关推荐
无限进步_12 分钟前
【C++】电话号码的字母组合:从有限处理到通用解法
开发语言·c++·ide·windows·git·github·visual studio
蜡台1 小时前
IDEA 一些 使用配置和插件
java·ide·intellij-idea
星马梦缘2 小时前
jupyter Kernel Disconnected崩溃的修复
ide·python·jupyter
蜡台3 小时前
JetBrains IDEA 安装 卸载相关总结
java·ide·intellij-idea·注册码
獨枭3 小时前
Visual Studio 打开 .vdproj 显示“不兼容”的问题分析与解决
ide·visual studio
克里斯蒂亚诺更新4 小时前
myeclipse和tomcat的使用
ide·tomcat·myeclipse
一定要AK5 小时前
SSM 整合实战—— IDEA 版
java·ide·intellij-idea
Freak嵌入式6 小时前
MicroPython LVGL基础知识和概念:交互与事件处理
ide·嵌入式·gui·lvgl·micropython·电子·upypi
Pixlout7 小时前
关于7元算子演算技术的个人笔记
ide·笔记·硬件工程
爱分享的阿Q7 小时前
从AI IDE到Agent统一工作区:开发环境的范式跃迁
ide·人工智能