(this: ComponentPublicInstance, key: InjectionKey<any> | string)
| 151 | |
| 152 | // Vue's inject() can only be used in setup |
| 153 | function inject (this: ComponentPublicInstance, key: InjectionKey<any> | string) { |
| 154 | const vm = this.$ |
| 155 | |
| 156 | const provides = vm.parent?.provides ?? vm.vnode.appContext?.provides |
| 157 | |
| 158 | if (provides && (key as any) in provides) { |
| 159 | return provides[(key as string)] |
| 160 | } |
| 161 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…