<el-table-column
type="selection"
width="55"
>
<template slot-scope="scope">
<el-checkbox
v-model="scope.row.selected"
:disabled="isDisabled(scope.row)"
@change="handleSelectionChange(scope.row)"
/>
</template>
</el-table-column>
data() {
return {
selectedRow: null
}
},
isDisabled(row) {
return this.selectedRow && !row.selected
},
handleSelectionChange(rows) {
this.selectedRow = rows.selected ? rows : null
},