首页 > 解决方案 > showCloseButton react-bootstrap-sweetalert 未显示

问题描述

我正在使用 libreact-bootstrap-sweetalert来处理弹出窗口。到目前为止,一切都很好。但是,当我尝试实现他们的其中一个道具时(此处showCloseButton描述),关闭按钮不会显示在我的警报中的任何位置。然后,我尝试在他们的示例中复制粘贴代码,这里是代码:

<SweetAlert
  custom
  showCancel
  showCloseButton
  confirmBtnText="Yes"
  cancelBtnText="No"
  confirmBtnBsStyle="primary"
  cancelBtnBsStyle="default"
  customIcon="https://raw.githubusercontent.com/djorg83/react-bootstrap-sweetalert/master/demo/assets/thumbs-up.jpg"
  title="Do you like thumbs?"
  onConfirm={this.onConfirm}
  onCancel={this.onCancel}
>
  You will find they are up!
</SweetAlert>

“x”关闭按钮仍然没有显示在我的警报中。然后,我尝试在他们的示例中显示警报,显示关闭按钮!这里出了什么问题?我已经复制粘贴了,它不起作用。但是,它正在他们的示例网站上工作。无论如何,我使用^4.4.1的是react-bootstrap-sweetalert.

标签: javascriptreactjssweetalert

解决方案


我认为该示例适用于其最新版本。请更新到最新!

showCloseButton这是因为我在 v4.4.1 中看不到该选项: https ://www.npmjs.com/package/react-bootstrap-sweetalert/v/4.4.1


推荐阅读