VUE報錯解決方法 Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.


vue在組件引入組件時寫成了

import {FileSidebar} from "@/components/FileSidebar/index";

會報Unknown custom element: <FileSidebar> - did you register the component correctly? For recursive components, make sure to provide the "name" option.的錯誤。

一開始誤以為是命名的問題。百度大部分都是這方面的解釋。當排除所有可能的問題后才發現......

正確寫法應為

import FileSidebar from "@/components/FileSidebar/index";

 

以前犯的一個初級錯誤,因為當時百度上沒看到解決方法。記錄一下希望對遇到同樣問題的同學有幫助。


免責聲明!

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



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