Browse Source

静态页面

xcx 4 years ago
parent
commit
a36d9ba543
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/pages/index.vue

+ 6
- 0
src/pages/index.vue View File

34
     }
34
     }
35
   },
35
   },
36
   mounted () {
36
   mounted () {
37
+    window.addEventListener('hashchange', () => {
38
+      let currentPath = window.location.hash.slice(1)
39
+      if (this.$route.path !== currentPath) {
40
+        this.$router.push(currentPath)
41
+      }
42
+    }, false)
37
     this.$nextTick(() => {
43
     this.$nextTick(() => {
38
     })
44
     })
39
   },
45
   },