mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:28:38 +08:00
修复404页面手动离开还会打开控制台页面的bug
This commit is contained in:
+7
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user