vue項目中,如果修改了組件名稱,vscode編輯器會在引入修改組件的名字處提示紅色波浪線 The file is in the program because:Imported via xxx Root file specified for compilation .


今天修改項目中的文件名發現vscode編輯器顯示紅色波浪線提示‘...Root file specified for compilation’這些內容,遂記之。

紅色波浪線提示內容大致是:

       The file is in the program because:Imported via xxx Root file specified for compilation .

背景描述:

       創建了一個名為  projectTest  vue項目;

目錄結構如下:
projectTest:
node_modules
public
src
assets
components // 小組件
views // 頁面組件
testView
index.vue // 假設已經修改了,index.vue 頁面引入 listFilter.vue的地方會顯示紅色波浪線提示
components
listFilter.vue // 如果一開始組件名稱是叫這個,然后修改組件名稱為 ListFilter.vue,那么進入 index.vue頁面中,就會發現紅色波浪線提示
App.vue
main.js
router
index.js
store
index.js
README.md
package.json
...

導致原因(vscode引起):

      一般情況是,開發者重新命名了自己的文件導致的。

解決辦法:

      保存文件后,關閉vscode編輯器,然后重新打開vscode,就會發現沒有這個紅色提示了。

 

參考鏈接:https://blog.csdn.net/kaimo313/article/details/115962879

 


免責聲明!

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



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