
<el-table @selection-change="handleSelectCodeForTicket" :data="tableData" :height="tableHeight" >
<el-table-column
type="selection"
width="50">
</el-table-column>
</el-table>
Selection: [],
methods: {
// 选择
handleSelectCodeForTicket (val) {
console.log(val)
this.Selection = []
val.forEach(v => {
this.Selection.push(v.code)
})
}
}

本文介绍了如何在Vue中使用Element UI的el-table组件实现表格的多选功能,并展示了如何监听selection-change事件来获取并处理选中的代码。方法部分详细讲解了如何清空已选代码并更新选中状态。
974

被折叠的 条评论
为什么被折叠?



