<template>
<div @click="clickJump()">提交</div>
</template>
<script>
export default {
data() {
return {
count: "", //倒计时
}
},
mounted() {
},
methods: {
//几秒后进入跳转页面
clickJump() {
const timejump = 1;
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: '/address'
});
}
}, 100)
}
},
}
}
</script>
vue实现几秒后跳转新页面demo示例(整理)
于 2019-04-20 13:10:52 首次发布