Skip to content

Commit

Permalink
fix(useRouteHash, useRouteParams, useRouteQuery): override only selec…
Browse files Browse the repository at this point in the history
…ted route param (#2350)
  • Loading branch information
dvh91 committed Oct 25, 2022
1 parent 5da4fe8 commit be36a7d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/router/useRouteHash/index.ts
Expand Up @@ -16,7 +16,7 @@ export function useRouteHash(
},
set(v) {
nextTick(() => {
router[unref(mode)]({ hash: v })
router[unref(mode)]({ ...route, hash: v })
})
},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/router/useRouteParams/index.ts
Expand Up @@ -25,7 +25,7 @@ export function useRouteParams<T extends string | string[]>(
},
set(v) {
nextTick(() => {
router[unref(mode)]({ params: { ...route.params, [name]: v } })
router[unref(mode)]({ ...route, params: { ...route.params, [name]: v } })
})
},
})
Expand Down
2 changes: 1 addition & 1 deletion packages/router/useRouteQuery/index.ts
Expand Up @@ -25,7 +25,7 @@ export function useRouteQuery<T extends string | string[]>(
},
set(v) {
nextTick(() => {
router[unref(mode)]({ query: { ...route.query, [name]: v === defaultValue || v === null ? undefined : v } })
router[unref(mode)]({ ...route, query: { ...route.query, [name]: v === defaultValue || v === null ? undefined : v } })
})
},
})
Expand Down

0 comments on commit be36a7d

Please sign in to comment.