vue根据条件不同显示不同按钮
作者:互联网
table表格展示数据 根据每条信息状态不同换按钮
<template slot-scope="scope"> <el-button v-if="scope.row.isDeleted === 0" @click="lowerShelf(scope.row.id)" size="mini" type="primary" plain>下架</el-button> <el-button v-else size="mini" type="primary" plain>已下架</el-button> </template>
根据跳转前网页传递信息 替换按钮
<!-- 按钮样式一 --> <el-form-item label-width="150px" style="width: 700px" v-if="form.status === '已驳回'" > <el-button type="primary" @click="onSubmit()" size="mini" >确定</el-button > <el-button @click="cancel()" size="mini">取消</el-button> </el-form-item>
<!-- 按钮样式二 --> <el-form-item label-width="150px" style="width: 700px" v-else> <el-button @click="cancel()" size="mini">返回</el-button> </el-form-item>
标签:vue,根据,不同,按钮,跳转,table,已下 来源: https://www.cnblogs.com/lyj0810/p/16343321.html