通过 Sweetalert 获取信息
Get information with Sweetalert
我的问题是是否有办法使用 sweet alert 来获取像 window.prompt
中那样的文本
例如:var name =window.prompt("Write your name","");
¿我可以用 sweetalert 做到这一点吗?*
根据 documentation,似乎以下承诺将 return 输入的内容。
swal({
text: 'Search for a movie. e.g. "La La Land".',
content: "input",
button: {
text: "Search!",
closeModal: false,
},
})
.then(name => {
console.log(name);
})
我的问题是是否有办法使用 sweet alert 来获取像 window.prompt
中那样的文本例如:var name =window.prompt("Write your name","");
¿我可以用 sweetalert 做到这一点吗?*
根据 documentation,似乎以下承诺将 return 输入的内容。
swal({
text: 'Search for a movie. e.g. "La La Land".',
content: "input",
button: {
text: "Search!",
closeModal: false,
},
})
.then(name => {
console.log(name);
})