首页 > 其他 > 详细

vue+element中,根据状态的不同,显示不同的操作按钮

时间:2020-08-03 23:26:12      阅读:670      评论:0      收藏:0      [点我收藏+]

原型效果:

技术分享图片

 

 代码实现:

 <el-table-column property="address" label="操作">
            <template slot-scope="scope">
              <el-button
                @click="setGrade(scope.row)"
                type="text"
                size="small"
                >等级设置</el-button
              >
              <el-button
                @click="evaluationResult(scope.row)"
                type="text"
                size="small"
                >等级评价结果</el-button
              >
              <el-button
                @click="handleClick(scope.row)"
                type="text"
                size="small"
                >修改</el-button
              >
              <el-button
              v-if="scope.row.module == ‘启用中‘"
                @click="handleClick(scope.row)"
                type="text"
                size="small"
                >停用</el-button
              >
              <el-button
              v-if="scope.row.module === ‘已停用‘"
                @click="handleClick(scope.row)"
                type="text"
                size="small"
                >启用</el-button
              >
              <el-button
                @click="handleClick(scope.row)"
                type="text"
                size="small"
                >删除</el-button
              >
            </template>
          </el-table-column>

通过 v-if指令 决定按钮的显示隐藏。

 

vue+element中,根据状态的不同,显示不同的操作按钮

原文:https://www.cnblogs.com/lyt0207/p/13428790.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!