.vue
<el-table
                ref="table"
                :data="tableData"
                height="100%"
                border
                stripe
                 @selection-change="handleSelectionChange"
                 @select="dialogCheck"
                style="width: 100%">
                <el-table-column align="center" type="selection" width="50"></el-table-column>
data(){
return{
selectioned:'',//单选中的值
}
}
methods:{
	            /*实现单选*/
        dialogCheck: function(selection, row) {
        this.$refs.table.clearSelection()
        if (selection.length === 0) { // 判断selection是否有值存在
            return
        }
        if (row) {
            this.selectioned = row
            this.$refs.table.toggleRowSelection(row, true)
        }
        },
}

在这里插入图片描述

css:
/deep/ .has-gutter{
    .el-checkbox{
        display: none;

    }
}
Logo

前往低代码交流专区

更多推荐