以下方法适用于 后台返回表头表体数据顺序一样;
table_head为表头数据,后台返回的是一个数组,数组中有name属性为表头;
<div class="flex-center" style="align-items: flex-start;padding: 0px 10px;">
<table class="layui-table">
<thead >
<tr style="background-color:#83a9f070;">
<th v-for="(info, index1) in table_head" :key="index1">{{info.name}}</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in ProcessInfo">
//ProcessInfo为表体数据,后台返回的是一个数组,数组里每个item为一行数据
<td v-for="(info, index1) in table_head" >{{item[info.name]}}</td>
</tr>
</tbody>
</table>
</div>