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

posted @ 2021-10-22 14:58  巨菜的小鸟  阅读(394)  评论(0编辑  收藏  举报