mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(nuxt): make runWithContext
generic (#28926)
This commit is contained in:
parent
5a61bc52f2
commit
275481c456
@ -275,7 +275,7 @@ export function createNuxtApp (options: CreateOptions) {
|
|||||||
static: {
|
static: {
|
||||||
data: {},
|
data: {},
|
||||||
},
|
},
|
||||||
runWithContext (fn: any) {
|
runWithContext <T>(fn: () => T) {
|
||||||
if (nuxtApp._scope.active && !getCurrentScope()) {
|
if (nuxtApp._scope.active && !getCurrentScope()) {
|
||||||
return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn))
|
return nuxtApp._scope.run(() => callWithNuxt(nuxtApp, fn))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user