Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a159d87

Browse files
committed
fix: return from rather than redirectedFrom from useContext
closes #444
1 parent 3f4f3d0 commit a159d87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/composables/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface UseContextReturn
2626
extends Omit<Context, 'route' | 'query' | 'from' | 'params'> {
2727
route: Ref<Route>
2828
query: Ref<Route['query']>
29-
from: Ref<Route['redirectedFrom']>
29+
from: Ref<Context['from']>
3030
params: Ref<Route['params']>
3131
}
3232

@@ -61,7 +61,7 @@ export const useContext = (): UseContextReturn => {
6161
/**
6262
* @deprecated To smooth your upgrade to Nuxt 3, it is recommended not to access `from` from `useContext` but rather to use the `useRoute` helper function.
6363
*/
64-
from: computed(() => vm.$route.redirectedFrom),
64+
from: computed(() => (vm[globalNuxt] || vm.$options).context.from),
6565
/**
6666
* @deprecated To smooth your upgrade to Nuxt 3, it is recommended not to access `params` from `useContext` but rather to use the `useRoute` helper function.
6767
*/

0 commit comments

Comments
 (0)