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'
88export class HashHistory extends History {
99 constructor ( router : VueRouter , base : ?string , fallback : boolean ) {
1010 super ( router , base )
11+ window . addEventListener ( 'hashchange' , ( ) => {
12+ this . onHashChange ( )
13+ } )
1114
1215 // check history fallback deeplinking
1316 if ( fallback && this . checkFallback ( ) ) {
Original file line number Diff line number Diff line change @@ -72,11 +72,7 @@ export default class VueRouter {
7272 if ( history instanceof HTML5History ) {
7373 history . transitionTo ( getLocation ( history . base ) )
7474 } else if ( history instanceof HashHistory ) {
75- history . transitionTo ( getHash ( ) , ( ) => {
76- window . addEventListener ( 'hashchange' , ( ) => {
77- history . onHashChange ( )
78- } )
79- } )
75+ history . transitionTo ( getHash ( ) )
8076 }
8177
8278 history . listen ( route => {
You can’t perform that action at this time.
0 commit comments