gpt4 book ai didi

sweetalert - 加载时设置甜蜜警报输入的值

转载 作者:行者123 更新时间:2023-12-02 08:12:28 25 4
gpt4 key购买 nike

在 sweet alert 2 中,如何在输入中加载设置值我的甜蜜警报代码

swal({
title: 'Are you sure?',
text: "You are going to send emails from the system. Please confirm",
showCancelButton: true,
input: 'email',

confirmButtonText: 'Submit',
confirmButtonColor: '#4aa0f1',
cancelButtonColor: '#898b8e',
confirmButtonText: 'Send'
}).then(function (email) {
send_email = email;
sentHtmtBody_send();
loadingIcon();
});

最佳答案

我们可以添加另一个字段

inputValue : 'test value',

添加完整代码后我们可以看到它

swal({
title: 'Are you sure?',
text: "You are going to send emails from the system. Please confirm",
showCancelButton: true,
input: 'email',
inputValue: "E.g john",
confirmButtonText: 'Submit',
confirmButtonColor: '#4aa0f1',
cancelButtonColor: '#898b8e',
confirmButtonText: 'Send'
}).then(function (email) {
send_email = email;
sentHtmtBody_send();
loadingIcon();
});

关于sweetalert - 加载时设置甜蜜警报输入的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45233123/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com