首先在标签中声明
@selection-change="handleSelectionChange"
之后在script中的methods当中编写该方法
console.log(this.$refs.cgTable.selection); 这一行代码可以获取你所选择的所有行 this.idList = this.$refs.cgTable.selection.map((item) => item.id); 运用map获取所有行当中的id for (let index = 0; index < this.idList.length; index++) { const element = this.idList[index]; console.log(element); } 循环读取即可获取id 之后将id作为参数对后端传参 标签:el,selection,idList,index,获取,vue,各列,id From: https://www.cnblogs.com/qq2803572183/p/17836625.html