目前正在进行个人项目开发。我希望用户点击按钮后,会出现一个SweetAlert提示框,用于验证他们的凭据。然而,我在SweetAlert网站上看到的代码只允许一个输入字段。以下是我目前拥有的代码:
swal({
title: "Authenicating for continuation",
text: "Test",
type: "input",
showCancelButton: true,
closeOnConfirm: false,
animation: "slide-from-top",
inputPlaceholder: "Write something"
}, function(inputValue) {
if (inputValue === false) return false;
if (inputValue === "") {
swal.showInputError("You need to write something!");
return false
}
// swal("Nice!", "You wrote: " + inputValue, "success");
});
那么,我能否获得两个输入字段呢?一个输入字段用于密码,另一个输入字段用于文本。