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/**/*"],  
  ...
}
相关推荐
大衛說7 小时前
02 · 环境搭建:uv 包管理与现代 IDE
ide·uv
cndes13 小时前
安装Miniconda+Jupyter notebook
ide·python·jupyter
洛兮银儿18 小时前
pycharm选中同一个词的标记颜色的修改
ide·python·pycharm
Sherotree1 天前
Google Antigravity——Agent 被提到主界面
前端·ide·后端·edge浏览器
YZJenny1 天前
在服务器上安装使用code-server(Web 版 VS Code)
ide·vscode·编辑器
salestina2 天前
vscode迁移扩展目录
ide·vscode·编辑器
铁手飞鹰3 天前
VSCode Python .embed 嵌入式环境黄色波浪线问题
ide·vscode·python
樱花落木兰3 天前
Git 超全零基础教程|三区原理、全套命令、分支协作、冲突解决、IDEA 集成(面试必备)
ide·git·json·github
Molesidy3 天前
【Embedded Development】基于VSCode+IAR插件的IAR工程开发环境的搭建
ide·vscode·编辑器
yangshuo12813 天前
用AI开发一个公网IP查询小工具:精准查询IDE/终端的真实出口IP(Python实战)
ide·人工智能·tcp/ip