javascript - 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
.
解决方案
我认为该示例适用于其最新版本。请更新到最新!
showCloseButton
这是因为我在 v4.4.1 中看不到该选项: https ://www.npmjs.com/package/react-bootstrap-sweetalert/v/4.4.1
推荐阅读
- nodemon - nodemon 已安装但无法在 win10 上运行
- tensorflow - 计算函数梯度的问题
- python - Python - Summation of a function implementation
- dns - 使用 godaddy 和第三方以及 IIS DNS
- javascript - JSON 对象的问题(深度搜索)
- javascript - onChange = {this.nameHandler} 可以调用 nameHandler = (event) =>{}
- postgresql - Postgres 的 AT TIME ZONE 不能在休眠状态下工作
- python - 在 Python 中有效地构造大量相似的对象
- go - 修复 GoLand 找不到模块依赖项(“无法解析...”)?
- javascript - 使用 React 在 Tabs 中显示现有的 JS/html 页面