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.

在.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来代替它们。】

报错文件如下:

修改为:

 成功显示:

 

posted @ 2017-08-19 11:07  RyanxChen  阅读(1295)  评论(0编辑  收藏  举报