SweetAlert2 (Swal) 是一个用于创建美观对话框的 JavaScript 库。以下是一些你可以使用 Swal 的例子:
- 基础警告框:
Swal.fire('Any fool can use a computer')
- 带标题的警告框:
Swal.fire(
'The Internet?',
'That thing is still around?',
'question'
)
- 成功提示框:
Swal.fire(
'Good job!',
'You clicked the button!',
'success'
)
- 错误提示框:
Swal