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

猜你喜欢

转载自www.cnblogs.com/opcec/p/9072973.html