功能:点击单行的button 改变其状态
代码部分:
判断表格中scope.row.status和identity的状态 来设置不同的可见的button
<el-table-column
prop="customerName"
label="操作"
min-width="80"
align="center"
fixed="right"
>
<template slot-scope="scope">
<el-button v-if="scope.row.status=='正常'&& scope.row.identity=='成员'" type="primary" size="medium" @click="Shutup_this(scope.$index, scope.row)">禁言</el-button>
<el-button v-else-if="scope.row.status=='黑名单' && scope.row.identity=='成员'" type="primary" size="medium" @click="cancel_Blacklist(scope.$index, scope.row)">取消黑名单</el-button>
<el-button v-else-if="scope.row.status=='禁言' && scope.row.identity=='成员'" type="primary" size="medium" @click="cancel_Shutup(scope.$index, scope.row)">取消禁言</el-button>
</template>
</el-table-column>