<el-table
slot="content"
ref="configTableRef"
:data="uploadConfigShowList"
style="width: 100%"
@row-click="rowClickFunc" // 行选中方法
@selection-change="handleSelectionChange" // 监听多选框勾选情况
>
<el-table-column type="selection" min-width="50%" />
<el-table-column label="配置选项" align="center" min-width="50%">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
</el-table>
methods: {
// 行选中
rowClickFunc(row) {
this.$refs.configTableRef.toggleRowSelection(row)
},
// 监听勾选
handleSelectionChange(targetList) {
// targetList 每行的内容
// 数据处理传参使用
let queryValueList = []
targetList.forEach(ite => {
queryValueList.push(ite.value)
})
this.checkedTypesArr = queryValueList
},
}
el-table 简易行选中取消