app.provide() App-Level Provide
Last updated: 2026-10-22
app.provide() App-Level Provide
app.provide() supplies a dependency app-wide so every component can inject it — for config and i18n instances.
| Group | Global API |
|---|---|
| Kind | API |
| Scope | Global |
| Vue Version | 3.0+ |
| SSR Support | Yes |
📝 Syntax
app.provide("i18n", i18nInstance)
⚙️ Arguments
| key, value | A key (string or Symbol) plus any value |
|---|
Returns:The app instance (chainable)
▶ Example
Edit the code below and see the live result:
Output:
Shows the provided config value.
💡 Key Points
ℹ️ Note Preferred over globalProperties — explicit and testable.
💡 Tip Common uses: i18n, theme config, logging.
⚠️ Warning Plain objects snapshot — provide refs for reactivity.
🏷️ Related Global API
💡 Related Cases
More case studies coming soon.
📚 Related Tutorials
❓ FAQ
Q Difference from component provide?
A App-level reaches every component; component-level is scoped.
Q Can functions be provided?
A Yes — often used for API clients and helpers.
Q Can it be overridden?
A A nearer provider overrides it.