<el-table :data="tableData" border style="width: 100%" class="table">
<el-table-column prop="state" label="状态" width="90">
<template slot-scope="scope">
<el-switch v-model="scope.row.state" @change="stateChanged(scope.row)" />
</template>
</el-table-column>
</el-table>
其中scope.row.state
为switch对应的值,stateChanged为switch改变时触发的方法
<template slot-scope="scope">
<el-switch v-model="scope.row.state" @change="stateChanged(scope.row)" />
</template>