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,6 +34,12 @@ export default {
34 34
     }
35 35
   },
36 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 43
     this.$nextTick(() => {
38 44
     })
39 45
   },