vue利用v-for嵌套输出多层对象,分别输出到个表的方法
更新时间:2018年09月07日 15:30:35 作者:阿之阿佐
今天小编就为大家分享一篇vue利用v-for嵌套输出多层对象,分别输出到个表的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
如下所示:
specifications:[
{
specificationName:"颜色",
specificationItem:[
{value:"黄色"},
{value:"黑色"}
]
}
]
<table class="table table-bordered table-hover table-item spggdytable"
id="ggxtable" v-show="isAddSpecifications">
<thead>
<tr>
<th>排序</th>
<th>规格项</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in specifications">
<td>{{index}}</td>
<td>{{item.specificationName}}</td>
<td>
<a href='#'> <img src='../img/common_edit@25.png' alt='修改'></a>
<a href='#'><img src='../img/common_del@25.png' alt='删除'></a>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-hover table-item spggdytable"
id="ggztable" v-show="isAddSpecifications">
<thead>
<tr>
<th>规格值</th>
<th>操作</th>
</tr>
</thead>
<tbody v-for="(item,index) in specifications">
<tr v-for="(part,n) in item.specificationItem">
<td>{{part.value}}</td>
<td>
<a href='#'> <img src='../img/common_edit@25.png' alt='修改'></a>
<a href='#'><img src='../img/common_del@25.png' alt='删除'></a>
</td>
</tr>
</tbody>
</table>

以上这篇vue利用v-for嵌套输出多层对象,分别输出到个表的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
vue element实现将表格单行数据导出为excel格式流程详解
这篇文章主要介绍了vue element实现将表格单行数据导出为excel格式流程,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习吧2022-12-12
vue-quill-editor+plupload富文本编辑器实例详解
这篇文章主要介绍了vue-quill-editor+plupload富文本编辑器实例详解,需要的朋友可以参考下2018-10-10


最新评论