码迷,mamicode.com
首页 > 其他好文 > 详细

vue报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

时间:2017-08-19 13:02:36      阅读:683      评论:0      收藏:0      [点我收藏+]

标签:image   multi   span   nbsp   images   多个   bsp   一个   str   

在.vue文件中引入了 element-ui 的 table 和 pagination 组件后,报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.【翻译:组件模板应该只包含一个根元素。 如果您在多个元素上使用v-if,请使用v-else-if来代替它们。】

报错文件如下:

技术分享

修改为:

技术分享

 成功显示:

技术分享

 

vue报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

标签:image   multi   span   nbsp   images   多个   bsp   一个   str   

原文地址:http://www.cnblogs.com/ryans/p/7395916.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!