修复404页面手动离开还会打开控制台页面的bug

This commit is contained in:
hooray
2020-11-24 09:06:15 +08:00
parent 7bddad9b51
commit 5a39b2f991
+7 -2
View File
@@ -11,16 +11,21 @@
<script>
export default {
beforeRouteLeave(to, from, next) {
clearInterval(this.inter)
next()
},
data() {
return {
inter: null,
countdown: 5
}
},
mounted() {
const inter = setInterval(() => {
this.inter = setInterval(() => {
this.countdown--
if (this.countdown == 0) {
clearInterval(inter)
clearInterval(this.inter)
this.goBack()
}
}, 1000)