Closed arnasziedavicius closed 5 years ago
When in middleware context, app, $moment seems to be undefined. When called in component, however, there seems to be no problem.
nuxt.config.js setup:
module.exports = { /* ** Modules */ modules: [ '@nuxtjs/moment', ], /* ** Moment */ moment: { locales: ['de'], plugin: true, }, /* ** Router */ router: { middleware: ['test'], }, };
Middleware (test.js) code where $moment is undefined:
export default function (context) { console.log(context.app.$moment); }
When does $moment get injected to Vue context and is there something I'm missing?
When in middleware context, app, $moment seems to be undefined. When called in component, however, there seems to be no problem.
nuxt.config.js setup:
Middleware (test.js) code where $moment is undefined:
When does $moment get injected to Vue context and is there something I'm missing?