fix(runtime-core): bind default function of inject to instance (#3925)
fix #3923
This commit is contained in:
@@ -60,7 +60,7 @@ export function inject(
|
||||
return provides[key as string]
|
||||
} else if (arguments.length > 1) {
|
||||
return treatDefaultAsFactory && isFunction(defaultValue)
|
||||
? defaultValue()
|
||||
? defaultValue.call(instance.proxy)
|
||||
: defaultValue
|
||||
} else if (__DEV__) {
|
||||
warn(`injection "${String(key)}" not found.`)
|
||||
|
||||
Reference in New Issue
Block a user