表格:
<el-table
ref="table"
v-adaptive="{bottomOffset: 65}"
v-loading="loading"
height="100px"
element-loading-text="刷新中,请稍候!!!"
:data="help_list"
:cell-style="{textAlign:'center'}"
:header-cell-style="{background:'#CDE0E7',color:'black',textAlign:'center'}"
:row-key="getRowKeys"
@selection-change="handleSelectionChange"
>
// :reserve-selection="true" 是可以做到分页记录数据的关键
<el-table-column
type="selection"
:reserve-selection="true"
width="55"
/>
</el-table>
方法
data(){
return:{
getRowKeys(row) {
return row.id
}
}
},
methods:{
handleSelectionChange(val) {
// console.log(val)
const arr = []
for (const item of val) {
arr.push(item.id)
}
this.selectionChangeList = arr
console.log(this.selectionChangeList)
}
}