1.第一种方式
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="{row}">
<el-switch
v-model="row.status"
active-color="#824C96"
:active-value="1"
:inactive-value="0"
@change="updateStatus(row)">
</el-switch>
</template>
</el-table-column>
2.第二种方式
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-color="#824C96"
:active-value="1"
:inactive-value="0"
@change="updateStatus(scope.row)">
</el-switch>
</template>
</el-table-column>
网友评论