elementui $confirm确认提示按钮居中

// 解绑
    unBind(row) {
      this.$confirm('是否确认解除该条表单绑定?', '确认', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        customClass: 'customConfirm',
        cancelButtonClass: 'btn-custom-cancel',
        type: 'warning'
      })
        .then(() => {
          this.$Puting(this.$api.updateFormBind, { relationId: row.relationId, defId: '' }).then((res) => {
            if (res.code === '0') {
              this.$message.success('解绑成功')
              this.updateData(row.pid)
            } else {
              this.$message.error(res.message)
            }
          })
        })
        .catch(() => {})
    },

增加了自定义样式 customConfirmbtn-custom-cancel
修改样式

.customConfirm .el-message-box__btns {
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-custom-cancel {
  margin-left: 10px;
  order: 2 /* 将取消置到后面 */
}
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。