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/**/*"],  
  ...
}
相关推荐
sinat_2554878116 小时前
第七部分。介绍MVC(模型-视图-控制器)模式
java·ide·http·tomcat·intellij-idea
Algorithm_Engineer_19 小时前
如何利用Pycharm进行分布式的Debug训练
ide·分布式·pycharm
Jumbo星20 小时前
新版vscode侧边资源管理器的文件搜索
ide·vscode·编辑器
我最爱吃鱼香茄子20 小时前
终极方案:JetBrains IDE永久解放C盘空间
计算机视觉·性能优化·电脑·笔记本电脑·intellij-idea·程序员创富·webstorm
ABAP-張旺21 小时前
ABAP:Visual Studio Code開發ABAP教程
ide·vscode·编辑器
stevenzqzq1 天前
vsCode AI插件
ide·人工智能·vscode
恣艺1 天前
解决 PyCharm 2024.1+ matplotlib 图表显示异常:Plots 工具窗口空白 / tostring_rgb 报错
ide·pycharm·matplotlib
专注VB编程开发20年1 天前
阿里通义灵码插件安装失败
开发语言·ide·c#·visual studio
李少兄1 天前
IDE 提示 “GitLab versions older than 14.0 are not supported” 的深度排查与解决方案
ide·gitlab
司悠2 天前
【解决在vscode里开服务器登录codeX后发消息会一直reconnecting】
服务器·ide·vscode