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

今天在使用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不知道要删除哪些东西,所以才会报错。

posted @ 2015-12-29 18:44  破男孩  阅读(3740)  评论(4编辑  收藏  举报