Vue.js · Function
inject
inject() gets a dependency provided by an ancestor or the app. It looks up the value by a string or Symbol key and can use a default when no provider exists.
Last updated
Syntax
inject(key, defaultValue?, treatDefaultAsFactory?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
providereadonlycomputedrefSymbol