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.

 

<div style="background: #424f63">
<el-row>
。。。
</el-row>
</div>
<div>
<el-row >
。。。
</el-row>

<el-row v-for="item in receiveInfo">
。。。
</el-row>
</div>

vue模板只能有一个根对象

所以你想要出现正常的效果,你的用一个div来或是别的标签来包裹全部的元素

正确写法:

<div>

  

<div style="background: #424f63">
<el-row>
。。。
</el-row>
</div>
<div>
<el-row >
。。。
</el-row>

<el-row v-for="item in receiveInfo">
。。。
</el-row>
</div>

</div>

地址:https://www.cnblogs.com/liziyou/p/6708537.html

posted @ 2018-05-22 17:04  11个条子  阅读(282)  评论(0编辑  收藏  举报