The Wayback Machine - https://web.archive.org/web/20210104174445/https://github.com/vuejs/vuex-router-sync/pull/100
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPDATE for Vue3 ( = vuex 4.x, vue-router 4.x) #100

Open
wants to merge 7 commits into
base: master
from

Conversation

@Spice-Z
Copy link

@Spice-Z Spice-Z commented Nov 23, 2020

To use vuex-router-sync in Vue 3.x, I updated vue, vuex and vue-router!
Changed src and test, currently the test is not perfect, help...😭

About vue-routers's afterEach

  • To mutate latest route info, this package using vue-router's afterEach function.
  • But vue-router v4.x only export add function, and doesn't export any list that registered afterEach.
  • I want to test unsync correctly remove router's afterEach hook, but I have no idea.

About vuex's watch

  • To sync router on store change, this package using vuex's watch function
  • But I can't find a way to confirm what is registered in watch hooks!
  • I want to test unsync correctly remove vuex's watch hook, but I have no idea...

About unsync test

  • Old unsync tests used some functions of vuex and vue-router.
  • But in Vue 3.x, I cannnot use those functinos.
  • I set new tests, directly watch store's state.
@Spice-Z Spice-Z marked this pull request as ready for review Nov 23, 2020
@@ -44,7 +44,7 @@ export function sync(
// sync router on store change
const storeUnwatch = store.watch(

This comment has been minimized.

@Danktuary

Danktuary Dec 30, 2020

The { sync: true } below should be changed to { flush: 'sync' } (Vue 2 vs Vue 3)

@@ -36,8 +36,8 @@
},
"homepage": "https://github.com/vuejs/vuex-router-sync#readme",
"peerDependencies": {
"vue-router": "^3.0.0",
"vuex": "^3.0.0"
"vue-router": "^4.0.0-rc.5",

This comment has been minimized.

@Akryum

Akryum Dec 30, 2020
Member

Maybe use stable version range to keep it clean?

@Akryum Akryum requested review from kiaking and posva Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.