html
<el-table
...
<!-- row-key的row.id是你的行唯一标识,一般用id,翻页选的关键 -->
:row-key="row => row.id"
<!-- selection-change选择后的回调函数 -->
@selection-change="selectionChange"
>
<el-table-column
...
<!-- 选择框 -->
type="selection"
<!-- 回显的关键 -->
reserve-selection
>
</el-table-column>
</el-table>
js
data(){
selectedList: [],
}
methods: {
// 选择后的回调函数
selectionChange(selection){
this.selectedList = []
selection.forEach(val => {
this.selectedList.push(val.id)
})
}
}
标签:el,selection,翻页,table,selectedList,row
From: https://www.cnblogs.com/aiyablog/p/17095199.html