Inject/provides can you just consume or can you also provide? #1845
-
Doesn't seem very useful to inject into routes, since your router is always pretty much right near the top of dep graph - it can just pull pinia DB as import or whatever. Much more useful would be the ability to |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can only inject. It allows to inject any globals like i18n or anything else that is provided with Note that importing from the root works in SPAs but doesn't on SSR (exposes to cross state pollution). That might be why you don't find this useful 😄 |
Beta Was this translation helpful? Give feedback.
-
Didn't even think about that. Didn't really think past not wanting to inject ( |
Beta Was this translation helpful? Give feedback.
You can only inject. It allows to inject any globals like i18n or anything else that is provided with
app.provide()
.Note that importing from the root works in SPAs but doesn't on SSR (exposes to cross state pollution). That might be why you don't find this useful 😄