elementUI中的 “this.$confirm“ 基本用法,“this.$confirm“ 调换 “确认“、“取消“ 按钮的位置

文章目录


前言

elementUI中的 "this.$confirm" 基本用法,"this.$confirm" 调换 "确认"、"取消" 按钮的位置


具体操作

基本用法

<script>
this.$confirm('这是数据(res.data)', '提示', {
   
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              cancelButtonClass: 'custom-cancel-button',//添加样式,将确认与取消按钮调换位置
              type: 'warning',//设置弹框类型
              showCancelButton: false,  //是否显示取消按钮
              showClose: false, //是否显示右上角的x
              closeOnClickModal: true, //是否可以点击空白处关闭弹窗
            })
              .then(() => {
   
                // this.$message({
   
                //   type: 'success',
                //   message: '删除成功!'
                // });
              })
              .catch(() => {
   
                // this.$message({
   
                //   type: 'info',
                //   message: '已取消删除'
                // });
              });
</script>


<style>
.el-message-box__btns {
   
    display: flex;
    flex-direction: row-reverse;
}
.custom-cancel-button {
   
    margin-left: 10px;
}
</style>

将确认与取消进行交换位置,添加css样式

在这里插入图片描述

CSS代码:

.el-message-box__btns {
   
    display: flex;
    flex-direction: row-reverse;
}
.custom-cancel-button {
   
    margin-left: 10px;
}

总结

elementUI中的 "this.$confirm" 基本用法,"this.$confirm" 调换 "确认"、"取消" 按钮的位置,添加一个类和css代码


最近更新

  1. 技术浅谈:如何入门一门编程语言

    2023-12-09 10:22:05       0 阅读
  2. C#如何进行深度学习对行人进行识别?

    2023-12-09 10:22:05       0 阅读
  3. 金南瓜科技的SECS/GEM解决方案

    2023-12-09 10:22:05       0 阅读
  4. Linux 系统监控工具深度解析:Glances 与 Nmon

    2023-12-09 10:22:05       1 阅读
  5. 使用YOLO5进行模型训练机器学习【教程篇】

    2023-12-09 10:22:05       1 阅读

热门阅读

  1. 华为交换机基本配置

    2023-12-09 10:22:05       41 阅读
  2. mysql怎么优化查询?

    2023-12-09 10:22:05       32 阅读
  3. HTB Devvortex

    2023-12-09 10:22:05       33 阅读
  4. 理解chatGPT的Function calling

    2023-12-09 10:22:05       34 阅读
  5. kafka主题分区副本集群的概念

    2023-12-09 10:22:05       38 阅读