【发布时间】:2021-05-14 18:01:26
【问题描述】:
在我的一个代码中,我使用了 javascript sweet alert 库:
https://limonte.github.io/sweetalert2/
https://github.com/limonte/sweetalert2
我想有条件地禁用确认按钮,但在文档中还没有找到这样的属性。
有人用过吗?
PS:在文档中我找到了swal.disableConfirmButton() 方法,但是在使用相同的 Angular 时会引发错误
__WEBPACK_IMPORTED_MODULE_7_sweetalert2___default.a.disableConfirmButton is not a function
【问题讨论】:
-
你如何在课堂上导入
swal? -
swal的配置工作正常,只需在按钮disabled时发出问题,否则一切都像魅力一样工作 -
你能展示整个代码你是如何禁用它的吗?
-
我刚刚添加了
swal.disableConfirmButton();这段代码用于禁用功能 -
我建议将 ngx-sweetalert2 与 is for angular only 一起使用。 github.com/sweetalert2/ngx-sweetalert2 。你用的是哪个版本?
标签: angular sweetalert