ElementUI el-table form row selection box to the radio

First, a table Giga

<el-table-column type="selection" width="55"></el-table-column>

Then, select all the hidden off the header Select None

thead .el-table-column--selection .cell{
    display: none;
}

A tabular and a ref, for example: ref="Table"(added el-table in an attribute)
to an event table Giga@selection-change="chooseInstance"

chooseInstance (val) {
    if (val.length > 1) {
        this.$refs.Table.clearSelection()
        this.$refs.Table.toggleRowSelection(val.pop())
    } else {
    }
},

If you want to achieve click on the table row on the radio, and added an @current-changeevent:
the event:

currentChange(currentRow, oldCurrentRow) {
    this.$refs.Table.toggleRowSelection(currentRow)
}

Guess you like

Origin www.cnblogs.com/wbyixx/p/11934719.html
Recommended