javascript - showCloseButton 未显示react-bootstrap-sweetalert

标签 javascript reactjs sweetalert

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

<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”关闭按钮仍然没有显示在我的警报中。然后,我尝试在他们的示例中显示警报,显示关闭按钮!这里出了什么问题?我复制粘贴了,没用。但是,它正在他们的示例网站上运行。无论如何,我使用的是 react-bootstrap-sweetalert 版本 ^4.4.1

最佳答案

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

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

关于javascript - showCloseButton 未显示react-bootstrap-sweetalert,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59148173/

相关文章:

javascript - 如何在 HTML 表单中输入 float ?

javascript - redux-persist 黑名单不起作用

node.js - 端口打开但连接被拒绝...centos 8/nginx/react/nodejs

javascript - SweetAlert2 取消按钮仍在提交表单

html - 如何在 Angular 6 项目中使用 sweetalert2 中的 InputValidator?

javascript - 如何删除 twitter-bootstrap-rails 中多余的 css 和 js 链接

javascript - 无法设置远程应答 sdp : Called in wrong state: stable

javascript - 在 Javascript 行为不稳定的情况下在两个状态之间应用转换

reactjs - react + asp.net core 独立项目托管(部署)建议

javascript - 突出显示 sweetAlert 中的默认文本输入