第一步,
<el-table-column label="状态" >
<template slot-scope="scope">
{{scope.row}}
</template>
</el-table-column>
其中scope.row属性能展示我们从后端获得的数据
第二步,从element-ui中找到开关模板switch,替换掉{{scope.row}}
<el-table-column label="状态" >
<template slot-scope="scope">
<el-switch v-model="scope.row.mg_state"> </el-switch>
</template>
</el-table-column>
结果展示: