如何在重定向之前显示确认警报?
How can I display a confirmation alert before redirecting?
如何在重定向前显示 swal 火灾警报?
<a :href="`/public/project/sendalert/${project.id}`">{project.first_name+' '+project.last_name}} @click="Alert"</a></strong></span>
alert() {
window.Swal.fire({
title: 'Are you sure?',
text: "Are you sure?"
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'YES!',
})
},
1.click 事件应放入属性中。
<a @click="Alert">{project.first_name+' '+project.last_name}}</a></strong></span>
2.execute 确认操作的重定向。
alert() {
window.Swal.fire({
title: 'Are you sure?',
text: "Are you sure?",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'YES!',
}, function (isConfirm) {
if (isConfirm) {
location.href = "...";
}
});
}
如何在重定向前显示 swal 火灾警报?
<a :href="`/public/project/sendalert/${project.id}`">{project.first_name+' '+project.last_name}} @click="Alert"</a></strong></span>
alert() {
window.Swal.fire({
title: 'Are you sure?',
text: "Are you sure?"
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'YES!',
})
},
1.click 事件应放入属性中。
<a @click="Alert">{project.first_name+' '+project.last_name}}</a></strong></span>
2.execute 确认操作的重定向。
alert() {
window.Swal.fire({
title: 'Are you sure?',
text: "Are you sure?",
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'YES!',
}, function (isConfirm) {
if (isConfirm) {
location.href = "...";
}
});
}