小编给大家分享一下Vue如何利用v-for嵌套输出多层对象,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!如下所示:specifications:[ {
小编给大家分享一下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嵌套输出多层对象”有了一定的了解,如果想了解更多相关知识,欢迎关注编程网node.js频道,感谢各位的阅读!
--结束END--
本文标题: vue如何利用v-for嵌套输出多层对象
本文链接: https://www.lsjlt.com/news/65505.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0