Use v-for in vue to traverse two-dimensional arrays.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.