<el-table highlight-current-row :data="dataList" border style="width: 100%" @current-change="handleSelectChange" >
<el-table-column label="选择" width="50" align="center">
<template slot-scope="scope">
<el-radio v-model="tabradio" :label="scope.row.id"> </el-radio>
</template>
</el-table-column>
<el-table-column prop="No" align="center" label="单号"></el-table-column>
</el-table>
<script>
export default {
data() {
return {
tableradio:'',
No:''
}
}
created() {
this.getRowClass()
},
//数据回显
getRowClass(rowIndex){
if(rowIndex){
this.tableradio = rowIndex;
}
},
//获取数据并选中
handleSelectChange(selection) {
this.tableradio = selection.id
},
}
el-table 单选及回显选中
最新推荐文章于 2024-05-29 10:03:31 发布