配置Vue中@符,出現路徑提示


1.Vs code商店搜索 Path Intellisense 插件安裝

2. 打開設置 - 首選項 - 搜索 Path Intellisense - 打開 settings.json ,添加:

 "path-intellisense.mappings": {
     "@": "${workspaceRoot}/src"
 }

3.項目根目錄創建  jsconfig.json 文件,添加如下代碼:

{
   "compilerOptions": {
       "target": "ES6",
       "module": "commonjs",
       "allowSyntheticDefaultImports": true,
       "baseUrl": "./",
       "paths": {
         "@/*": ["src/*"]
       }
   },
   "exclude": [
       "node_modules"
   ]
}

4.重啟項目即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM