其他分享
首页 > 其他分享> > sweetalert2的基本用法

sweetalert2的基本用法

作者:互联网

github

https://github.com/sweetalert2/sweetalert2/

theme

https://github.com/sweetalert2/sweetalert2-themes

Examples

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/themes@4.0.3/bootstrap-4/bootstrap-4.min.css">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9/dist/sweetalert2.min.js"></script>


<script>
	Swal.fire({
		icon: 'info'//'success' | 'error' | 'warning' | 'info' | 'question'
		, title: '请完善您的企业资料'
		, text: '请完善您的企业资料以免错失良才'
		, showCancelButton: true
		, confirmButtonText: '立即完善'
		, cancelButtonText: '过会再说'
	}).then(res => {
		console.log(res)
		if (res.isConfirmed) {
			location.href = '/Hr/Ent/edit'
		}
	})
	sessionStorage.setItem('perfectEntTip', 'show')
</script>

标签:基本,info,github,res,用法,https,sweetalert2,com
来源: https://www.cnblogs.com/sunr/p/16671458.html