el-table 单选

<el-table
                    ref="siteProblemDom"
                    :data="siteProblemTableData"
                    border
                    tooltip-effect="dark"
                    style="width: 100%;"
                    @select="siteProblemSelectionChange">
                    <el-table-column
                    type="selection"
                    width="55">
                    </el-table-column>
</el-table>
siteProblemSelectionChange(val) {
        if(val.length){
            // 将所有选中清空
            this.$refs.siteProblemDom.clearSelection();
            // 选中一个
            this.$refs.siteProblemDom.toggleRowSelection(val.pop());
        }
}
//隐藏全选框
::v-deep .el-table__header-wrapper {
    .el-table-column--selection {
        .el-checkbox {
        display: none !important;
        }
    }
}

 

posted @ 2022-09-12 23:17  保洁叔叔  阅读(136)  评论(0)    收藏  举报