我正在使用 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/