File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ import { cleanPath } from '../util/path'
8
8
export class HashHistory extends History {
9
9
constructor ( router : VueRouter , base : ?string , fallback : boolean ) {
10
10
super ( router , base )
11
+ window . addEventListener ( 'hashchange' , ( ) => {
12
+ this . onHashChange ( )
13
+ } )
11
14
12
15
// check history fallback deeplinking
13
16
if ( fallback && this . checkFallback ( ) ) {
Original file line number Diff line number Diff line change @@ -72,11 +72,7 @@ export default class VueRouter {
72
72
if ( history instanceof HTML5History ) {
73
73
history . transitionTo ( getLocation ( history . base ) )
74
74
} else if ( history instanceof HashHistory ) {
75
- history . transitionTo ( getHash ( ) , ( ) => {
76
- window . addEventListener ( 'hashchange' , ( ) => {
77
- history . onHashChange ( )
78
- } )
79
- } )
75
+ history . transitionTo ( getHash ( ) )
80
76
}
81
77
82
78
history . listen ( route => {
You can’t perform that action at this time.
0 commit comments