赞
踩
<div class="box-pos"> <el-table ref="table" :header-cell-style="{ color: '#FFF', background: '#333' }" :cell-style="{ color: '#FFF', background: '#333' }" :data="grListData" style="width: 100%" @selection-change="selectionChange"> <template slot="empty"> <span style="color: #969799">{{ $t("NeoLight.empty") }}</span> </template> <el-table-column type="selection" width="50" /> <el-table-column prop="plantCode" label="厂区" /> <el-table-column prop="grCode" label="单据号" /> <el-table-column prop="grItem" label="单据行" /> <el-table-column prop="grDate" label="单据日期" /> <el-table-column prop="materialCode" label="料号" /> //........ </el-table> </div>
data() {
return {
multipleSelection: [],
};
},
methods: {
selectionChange(data) {
this.multipleSelection = []
if (data.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(data[data.length - 1])
}
this.multipleSelection = data[data.length - 1] ? [data[data.length - 1]] : []
},
}
.box-pos {
/**找到表头那一行,然后把里面的复选框隐藏掉**/
::v-deep .el-table__header-wrapper .el-checkbox {
display: none !important;
}
}
参考链接:https://blog.csdn.net/a772116804/article/details/131899825
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。