Fork me on GitHub

elementui table 多选 获取id

//多选相关方法
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
let ids = []
this.multipleSelection.map((item)=> {
ids.push(item.key)
})
this.selectedIDs = ids
console.log('多选',this.selectedIDs)
},
posted @ 2018-05-15 21:31  思考的大腿  阅读(10213)  评论(1编辑  收藏  举报