error

vue It's used in the design Element-ui assembly table, At the same time, the v-for="(item,index) in mydata"

Cause of error

table The loop traversal is as follows , It has its own rules

Or use the following traversal method

If your tableData It's as follows , Then there's no need prop How to do loop traversal ?

use scope.row Just get the element

 

Or use the following custom traversal method
<el-table :data="data" border > <el-table-column prop="userName"
:label="$t('user.username')" > </el-table-column> <!-- Traversal of custom columns -->
<el-table-column v-for="(item, index) in colunmName" :key="index" :label="item"
> <!-- Data traversal scope.row It represents every object of data --> <template slot-scope="scope"> <span>{
{scope.row.list[index].value}}</span> </template> </el-table-column>
</el-table-column> <el-table-column prop="Total" :label="$t('ad.totalNumber')"
> </el-table-column> </el-table>
 

Technology