File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ exports.sync = function (store, router) {
6
6
var currentPath
7
7
8
8
// sync router on store change
9
- store . watch (
9
+ store . _vm . $ watch(
10
10
function ( state ) {
11
11
return state . route
12
12
} ,
@@ -29,20 +29,21 @@ exports.sync = function (store, router) {
29
29
}
30
30
var to = transition . to
31
31
currentPath = to . path
32
- store . dispatch ( 'router/ROUTE_CHANGED' , to )
32
+ var commit = store . commit || store . dispatch
33
+ commit ( 'router/ROUTE_CHANGED' , to )
33
34
} )
34
35
}
35
36
36
37
function patchStore ( store ) {
37
38
// add state
38
39
var set = store . _vm . constructor . set
39
- store . _dispatching = true
40
+ store . _dispatching = store . _committing = true
40
41
set ( store . state , 'route' , {
41
42
path : '' ,
42
43
query : null ,
43
44
params : null
44
45
} )
45
- store . _dispatching = false
46
+ store . _dispatching = store . _committing = false
46
47
// add mutations
47
48
store . hotUpdate ( {
48
49
modules : {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vuex-router-sync" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.1 " ,
4
4
"description" : " Effortlessly keep vue-router and vuex store in sync." ,
5
5
"main" : " index.js" ,
6
6
"repository" : {
19
19
},
20
20
"homepage" : " https://github.com/vuejs/vuex-router-sync#readme" ,
21
21
"peerDependencies" : {
22
- "vuex" : " >=0.6.2" ,
22
+ "vuex" : " >= 0.6.2 < 3 " ,
23
23
"vue-router" : " >=0.7.11"
24
24
}
25
25
}
You can’t perform that action at this time.
0 commit comments