我想按月显示表格日期。如何循环表数据?请让我看看。
我尝试过:
tableData: [
{
totalSale: 1,
totalBorrow: 0,
total: 1,
details: [
{
date: moment("2024-08-01").format("DD/MM/YYYY"),
totalSale: 1,
totalBorrow: 0,
total: 1,
},
],
},
{
totalSale: 2,
totalBorrow: 1,
total: 3,
details: [
{
date: moment("2024-09-01").format("DD/MM/YYYY"),
totalSale: 1,
totalBorrow: 0,
total: 1,
},
],
},
],
我的结果:
我认为您将需要一些额外的逻辑来根据 1-30 和 1-31 制作表格,因为没有足够的代码来帮助您,您可以循环获取如下表格:-
<div v-for="data in tableData">
<tr>
<td>{{data.details[0].dat}}</td>
<td>{{data.totalSale}}</td>
</tr>
</div>
等等