将按钮的位置更改为垂直而不是水平

Change the position of buttons to be vertical rather than horizontal

有没有办法将按钮的位置或对齐方式更改为垂直而不是水平? 我环顾四周,但除了更改 CSS 的提示外,找不到任何具体内容。 但是这个选项看起来很麻烦而且不确定如何工作。

有人可以帮我吗?

给你:

Swal.fire({
  title: 'SweetAlert2 Vertical Buttons',
  showCancelButton: true,
  customClass: {
    actions: 'vertical-buttons',
    cancelButton: 'top-margin'
  }
})
.vertical-buttons {
  flex-direction: column;
}

.top-margin {
  margin-top: .5em;
}
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>