Nuxt3 Support
See original GitHub issueIf I get more time I will make this a PR.
I have written a DayJS plugin for nuxt3 and so far its working pretty well:
plugnis/dayjs.ts
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime.js'
import { defineNuxtPlugin } from '#app'
export default defineNuxtPlugin((nuxtApp) => {
dayjs.extend(relativeTime)
nuxtApp.provide('dayjs', dayjs)
})
declare module '#app' {
interface NuxtApp {
$dayjs: dayjs.Dayjs
}
}
I assume next steps are to transfer this into the template/runtime format and plug in the locale config.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:19
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Nuxt: The Intuitive Web Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework under MIT license that makes web development simple and powerful....
Read more >Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >Nuxt 3 support : WEB-54200 - YouTrack
To support Nuxt 3 we need: WEB-53890 - index d.ts files in .nuxt folder; WEB-54199 - recognize GlobalComponents Vue 3 interface; remove special...
Read more >Modules support status · Discussion #751 · nuxt/framework
Currently, we are trying hard to make the bridge module more stable and provide tooling and documentation for module authors in order to...
Read more >Nuxt (@nuxt_js) / Twitter
One of the core features of Nuxt 3 is the layers system Extend a default Nuxt ... Features Support nuxt v3 rc.11 -...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @potato4d! I was working on a Nuxt 3 version of this module a while ago. Would you be interested in taking a look? It has
useDayjs()
composable and auto register of dayjs types.I’ve created a Nuxt 3 module using the official Nuxt 3 module-builder: https://github.com/nathanchase/dayjs/
It’s on npm currently at: https://www.npmjs.com/package/@nathanchase/nuxt-dayjs-module
It’s barebones, and some of the plugins I use are hardcoded into it. Someone else might be able to make it more modular to use the same
dayjs
configuration object that the Nuxt 2 dayjs-module uses to specify plugins and other options?I wasn’t sure the protocol of how to submit this as a PR for this module, since it’s vastly different. You can check the playground for examples of the module working.
Take a look @potato4d, and see what you think.