怎么拿表格當前行數據
平時我們在使用表格時通過template的slot-scope="scope",使用scope.row拿到當前行的數據
<el-table max-height="290" :data="userTableData" border style="width: 100%"> <el-table-column label="名字"> <template slot-scope="scope"> {{scope.row.name}} </template> </el-table-column> <el-table-column label="年齡"> <template slot-scope="{row}"> {{row.age}} </template> </el-table-column> </el-table>
怎么拿表格當前行索引值
<el-table max-height="290" :data="userTableData" border style="width: 100%"> <el-table-column label="序號"> <template slot-scope="scope"> {{scope.$index+1}} </template> </el-table-column> </el-table>
From: https://blog.csdn.net/meimeib/article/details/111075715