element table 操作列不同标签显示
效果图如下
通过slot-scope="scope" 与v-if搭配data数据传过来的值显示不同按钮
<template slot-scope="scope"> <el-button type="text" class="btn_green" v-if="scope.row.jjjj==0" @click="Details" >查看</el-button> <el-button type="text" class="btn_green" v-if="scope.row.jjjj==0" @click="Details">修改</el-button> <el-button type="text" class="btn_green" v-if="scope.row.jjjj==1" @click="Details2(scope.row)" style="color:#D7BF48">配置</el-button> </template>
{{scope.row}}是el-table的 :data