We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 942f1af commit 8210b0dCopy full SHA for 8210b0d
src/index.ts
@@ -36,8 +36,9 @@ export const gReactive = resetableReactive // alias
36
export const whenRouteChange = (callback: () => void, watchSource?: () => unknown) => {
37
const route = useRoute()
38
const routeName = route.name // cache route name
39
+ const watchRouteParamsAndQuery = () => JSON.stringify([route.query, route.params])
40
watch(
- watchSource ?? (() => route.fullPath),
41
+ watchSource ?? watchRouteParamsAndQuery,
42
() => {
43
if (route.name === routeName) {
44
callback()
0 commit comments