@nuxtjs/dayjs
The best way for use Day.js easily in your Nuxt.js project.
Last updated a month ago by potato4d .
MIT · Original npm · Tarball · package.json
$ cnpm install @nuxtjs/dayjs 
SYNC missed versions from official npm registry.

@nuxtjs/dayjs

code style: prettier donate: Patreon License: MIT NPM version All Contributors NPM downloads codecov

The best way for use Day.js easily in your Nuxt.js project.

Installation

$ yarn add @nuxtjs/dayjs # or npm install

Usage

1. Register dayjs module to your Nuxt Application

export default {
  // ...
  modules: [
    '@nuxtjs/dayjs'
  ],

  // Optional
  dayjs: {
    locales: ['en', 'ja'],
    defaultLocale: 'en'
  }
  // ...
}

2. Use $dayjs on Context, Vue instance

with Context

<script>
export default {
  asyncData({ $dayjs }) {
    return {
      now: $dayjs().format('YYYY/MM/DD')
    }
  }
}
</script>

with Vue instance

<script>
export default {
  data() {
    return {
      latestClicked: null
    }
  },
  methods: {
    handleClickButton() {
      this.latestClicked = this.$dayjs().format('YYYY/MM/DD')
    }
  }
}
</script>

For Typescript users

Add the types to your "types" array in tsconfig.json after the @nuxt/types entry.

tsconfig.json

{
  "compilerOptions": {
    "types": [
      "@nuxt/types",
      "@nuxtjs/dayjs"
    ]
  }
}

Development

$ git clone https://github.com/nuxt-community/dayjs-module.git
$ cd @nuxtjs/dayjs
$ yarn

License

MIT @potato4d

Note

This project generated by create-nuxt-module

Contributors

Thanks goes to these wonderful people (emoji key):


Takuma HANATANI(@potato4d)

???? ???? ???? ???? ???? ????

Bryan Daniel Velastegui Lucero

????

This project follows the all-contributors specification. Contributions of any kind welcome!

Current Tags

  • 1.2.0                                ...           latest (a month ago)

13 Versions

  • 1.2.0                                ...           a month ago
  • 1.1.12                                ...           a month ago
  • 1.1.11                                ...           a month ago
  • 1.1.10                                ...           a month ago
  • 1.1.9                                ...           4 months ago
  • 1.1.8                                ...           4 months ago
  • 1.1.7                                ...           5 months ago
  • 1.1.6                                ...           5 months ago
  • 1.1.5                                ...           5 months ago
  • 1.1.4                                ...           5 months ago
  • 1.1.3                                ...           6 months ago
  • 1.1.2                                ...           6 months ago
  • 0.0.0                                ...           6 months ago
Downloads
Today 0
This Week 30
This Month 78
Last Day 5
Last Week 19
Last Month 110
Dependencies (2)
Dev Dependencies (16)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |