1.弹框
this.$alert('企业解散成功,您即将退出系统!<br/>', '', {
showClose:false,
showCancelButton:false,
showConfirmButton:false,
closeOnPressEscape:false,
closeOnHashChange:false,
center:true,
type:'warning',
dangerouslyUseHTMLString: true
});
2.利用javascript删除弹框
this.autoTimer = setInterval(()=>{
if(time === 1){
clearInterval(this.autoTimer);
removeSessionStore(SESSION_ID);
let messageBox = document.getElementsByClassName("el-message-box__wrapper");
let model = document.getElementsByClassName("v-modal");
if(messageBox){
messageBox[0].parentNode.removeChild(messageBox[0]);
model[0].parentNode.removeChild(model[0]);
}
this.$router.push({ name: "login" });
}
time--;
},1000);
本文介绍了一种在企业解散场景下使用Vue.js显示警告弹框的方法,并通过JavaScript定时器实现弹框的自动关闭及用户会话的清除,最后跳转至登录页面。
94

被折叠的 条评论
为什么被折叠?



