You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:fire:**HEADS UP!** You're currently looking at Vuex Router Synx 6 branch which supports Vue 3. If you're looking for Vuex Router Sync 5 for Vue 2 support, [please check out `dev` branch](https://github.com/vuejs/vuex-router-sync).
11
+
12
+
---
13
+
8
14
Sync Vue Router's current `$route` as part of Vuex store's state.
9
15
10
16
[中文版本 (Chinese Version)](README.zh-cn.md)
11
17
12
18
## Usage
13
19
14
20
```bash
15
-
# the latest version works only with vue-router >= 2.0
16
-
npm install vuex-router-sync
17
-
18
-
# for usage with vue-router < 2.0:
19
-
npm install vuex-router-sync@2
21
+
npm install vuex-router-sync@next
20
22
```
21
23
22
24
```js
23
25
import { sync } from'vuex-router-sync'
24
26
importstorefrom'./store'// vuex store instance
25
27
importrouterfrom'./router'// vue-router instance
26
28
27
-
constunsync=sync(store, router) // done. Returns an unsync callback fn
29
+
constunsync=sync(store, router) // done. returns an unsync callback fn
28
30
29
31
// bootstrap your app...
30
32
31
-
//During app/Vue teardown (e.g., you only use Vue.js in a portion of your app
33
+
//during app/Vue teardown (e.g., you only use Vue.js in a portion of your app
32
34
// and you navigate away from that portion and want to release/destroy
0 commit comments