Vue自动跳转另一个界面


<template>
<div class = "hello">
<h1>{{msg}}</h1>
<span id ="num">{{count}}</span>秒后跳转到登录界面
</div>
</template>

<script>
export default {
name: "Hello",
data () {
return {
msg:'欢迎进入教育机构访客系统',
count:" "//倒计时
}
},
created() {
this.ClickJump()
},
methods: {
//跳转界面
ClickJump(){
const timejump = 3;
if(!this.timer){
this.count = timejump ;
this.show = false;
this.timer = setInterval(()=>{
if(this.count > 0 && this.count <= timejump ){
this.count--;
}else{
this.show = true;
clearInterval(this.timer);
this.timer = null;
//跳转的页面写在此处
this.$router.push({path: 'Login'});
}
},1000)
}
},
}
}
</script>

<style scoped>

</style>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM