inject
goes unused:export default ({ app }, inject) => {
// Set `i18n` instance on `app`
// This way we can use it in middleware and pages `asyncData`/`fetch`
app.i18n = new VueI18n({
/* `VueI18n` options... */
})
}
however, it is named in the function signature.
v1.0.0-rc3
say a previous version called injectAs
was removed:
injectAs
has been removed in plugins, you can inject your plugins by accessingapp
(see example)
inject
in v1.0.0-rc7This version is only actually used in one file which is not featured in the examples on the site: https://github.com/nuxt/nuxt.js/blob/ffe1b6d8dc092f22b45b765f296b0700fd05eae9/examples/with-cookies/plugins/cookies.js#L19
In v1.0.0-rc11
it currently works.
When to use context.app.x =
vs inject('x',
?