@@ -5,7 +5,7 @@ import { warn } from './warning'
|
||||
|
||||
export interface InjectionKey<T> extends Symbol {}
|
||||
|
||||
export function provide<T>(key: InjectionKey<T> | string, value: T) {
|
||||
export function provide<T>(key: InjectionKey<T> | string | number, value: T) {
|
||||
if (!currentInstance) {
|
||||
if (__DEV__) {
|
||||
warn(`provide() can only be used inside setup().`)
|
||||
|
||||
@@ -667,9 +667,9 @@ export function applyOptions(
|
||||
const provides = isFunction(provideOptions)
|
||||
? provideOptions.call(publicThis)
|
||||
: provideOptions
|
||||
for (const key in provides) {
|
||||
Reflect.ownKeys(provides).forEach(key => {
|
||||
provide(key, provides[key])
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user