New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lack of compatibility with Nuxt 3 #82
Comments
Is there any intention of updating this for nuxt3? |
I've tried this and it works.
nuxt.config.ts
Using
|
For those who are still facing this problem, here's a short handed approach for implementing momentJs in Nuxt 3:
import moment from "moment";
export default defineNuxtPlugin((nuxtApp) => {
return {
provide: {
relative:(d) => moment().from(d)
}
}
})
<template>
<h1>{{ $relative(Date.now()) }}</h1>
</template> |
How can we enable moment timezone module with this approach? I have this now: import moment from 'moment'
export default defineNuxtPlugin(() => {
moment.locale('nl')
moment.tz.setDefault('Europe/Amsterdam')
return {
provide: {
moment,
},
}
}) but it gives an error |
I found out we just need to replace This is import moment from 'moment-timezone'
export default defineNuxtPlugin(() => {
moment.locale('nl')
moment.tz.setDefault('Europe/Amsterdam')
return {
provide: {
moment,
},
}
}) |
Are there any plans for making this module compatible with Nuxt 3?
The text was updated successfully, but these errors were encountered: