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/**/*"],  
  ...
}
相关推荐
摇滚侠13 天前
IDEA 创建 Java 项目 手动整合 SSM 框架
java·ide·intellij-idea
霸道流氓气质13 天前
Trae IDE 新手入门指南
ide
爱就是恒久忍耐13 天前
VSCode里如何比较2个branch
ide·vscode·编辑器
bloglin9999913 天前
vscode中可视化的合并分支,在“合并编辑器中解析”中“与基线进行比较”是什么意思
ide·vscode·编辑器
终将老去的穷苦程序员13 天前
IntelliJ IDEA 的安装教程
java·ide·intellij-idea
春日见14 天前
vscode的AI编程插件推荐:
大数据·ide·vscode·算法·机器学习·编辑器·ai编程
lazy H14 天前
Spring Boot 项目如何连接 Redis?新手入门配置和常见错误总结
ide·spring boot·redis·后端·学习·intellij-idea
2601_9620549514 天前
终端与IDE形态的vibe coding实测:两款AI编程工具迭代能力对比
数据库·ide·ai编程
jieshenai14 天前
VScode sys.path,并使CTRL+左键可访问源码
ide·vscode·编辑器
qq_4480111614 天前
VSCode环境搭建
ide·vscode·编辑器