sweetalert弹框插架--自定义多按钮事件
1.引入css js
<link rel="stylesheet" href="/css/sweetalert/sweetalert.css" />
<script src="/js/sweetalert/sweetalert.min.js"></script>
2.、
function tj() {
swal({
title : "提交成功",
text : "您的信息正在审核中",
icon : "success",
buttons : {
button1 : {
text : "回到首页",
value : true,
},
button2 : {
text : "回到个人中心",
value : false,
}
},
}).then(function(value) { //这里的value就是按钮的value值,只要对应就可以啦
if (value) {
window.location.href = "/"
} else {
window.location.href = "/one/user"
}
});
}
3..源代码
https://download.****.net/download/t617ing/10653797