el-table选择多行数据时使用 Checkbox,那么同样的,如果想支持单选的话,我们就可以把Checkbox的功能改为Radio即可。
<el-table
:data="tableData"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
label="选择项"
width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"></el-radio>
</template>
</el-table-column>
</el-table>
data(){
return{
tableRadio: '',
}
}
handleSelectionChange(currentRow){
this.tableRadio = currentRow
}