Use v-for in vue to traverse two-dimensional arrays.
As follows:
<table cellpadding="0" cellspacing="0" class="clearfix bigTable" id='downloaddata'> <tr v-for='(item, index) in data'> <template v-for='items in item'> <template v-for='(itemss, indexs) in items' v-if='indexs !== "type"'> <td>{{itemss}}</td> </template> </template> </tr>
The data is as follows:
This. data = [[{type: '', name: 'asset ', start: 'End balances', end: 'End balances '}, {type:'', name: 'liabilities and owner equity (or shareholder equity) ', start: 'End balances', end: 'End balances '}], [{type: '', name: 'asset ', start: 125000, end: 12534567}, {type: '', name: 'debt', start: 125000, end: 12534567}], [{type: 'asset ', name: 'Monetary fund', start: 125000, end: 12534567 },{ type: 'debt ', name: 'short-term financing payable', start: 125000, end: 12534567}], [{type: 'asset ', name: 'Here: customer deposit', start: 125000, end: 12534567}, {type: '', name: 'owner equity (or shareholder equity) ', start: 125000, end: 12534567}], [{type: 'asset', name: '', start:'', end: ''}, {type: 'Ownership equity (or shareholder equity ', name: 'paid-in capital (or equity)', start: 125000, end: 12534567}], [{type: 'asset ', name: 'total asset', start: 111, end: 11}, {type: 'owner equity (or shareholder equity ', name: 'capital accumulation ', start: 125000, end: 12534567}]
Result:
The above method of traversing two-dimensional arrays using v-for in vue is all the content shared by Alibaba Cloud xiaobian. I hope you can give us a reference and support for the customer's house.