because the component is a fragment instanc" type="hidden"/>

[Vue warn]: Attribute "id" is ignored on component


今天在使用vue框架搭建環境時,遇到這個錯誤提示:

[Vue warn]: Attribute "id" is ignored on component <div> because the component is a fragment instanc

 

這個提示的原因是使用 vue-router 和 vue-loader 插件的時候在最外面那個 template 里面,所有內容的外面沒有使用一個div包起來。

 

如果沒有使用div或者其他的元素包起來,vue-router 跳轉時,vue不知道要刪除哪些東西,所以才會報錯。


免責聲明!

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



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