소스 검색

静态页面

xcx 4 년 전
부모
커밋
a36d9ba543
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6
    0
      src/pages/index.vue

+ 6
- 0
src/pages/index.vue 파일 보기

@@ -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
   },