如果输入框需要增加非空判断,可将 popups.js 的 prompt 部分改成如下代码:
if (prompt) {
$(document).delegate('#yes_btn', 'click', function() {
let value = $('.prompt-text').val();
if (value == '') {
jqtoast('内容不能为空');
return;
}
setTimeout(function() {
al.remove();
}, 300);
if (yesfn) {
param.yesfn();
yesfn = '';
}
param = {};
});
} else {
$(document).delegate('#yes_btn', 'click', function() {
setTimeout(function() {
al.remove();
}, 300);
if (yesfn) {
param.yesfn();
yesfn = '';
}
param = {};
});
}
回复
confirm弹窗,点击取消,确认事件就不能再点了