vue-cli-plugin-dayjs

Vue CLI 3 plugin to add dayjs to your vue project
3,323
Install
npm install vue-cli-plugin-dayjs
Latest Version:0.1.2
License:MIT
Last Updated:Nov 27, 2019
Links: npm
Maintainer: sy97

vue-cli-plugin-dayjs

Vue CLI 3 plugin to add dayjs to your vue project.

🔥Install

❗️Do not install this package as a dependency, it will install the plugin source code instead installing the plugin, use the following command if your project is based on vue-cli 3+, it will automatically install day.js as devDependency and expose the $day() method as a Vue prototype for you to use in SFCs. Learn more about vue-cli plugins here: https://cli.vuejs.org/guide/plugins-and-presets.html

vue add dayjs

👾Usage

You can use the this.$day() method anywhere in your SFCs, to use it outside of SFCs, for example in vuex store files or js files simply import dayjs. Learn more about day.js here: https://github.com/iamkun/dayjs

this.$day()

💻Examples

SFCs

<!-- inside template/html -->
<template>
  <p>{{ $day().format('DD-MM-YY hh:mma') }}</p> <!--  11-05-2019 04:05pm  -->
</template>
// insdie script
<script>
export default {
  created() {
    const now = this.$day().format('DD-MM-YY hh:mma')
    console.log(now) // 11-05-2019 04:05pm 
  }
}
</script>

Related Packages

vue-cli-plugin-sitemap

A Vue CLI plugin to generate simple or complex sitemaps effortlessly.

22,340 41
vue-cli-plugin-sitemap-bk

A Vue CLI plugin to generate simple or complex sitemaps effortlessly.

391 0
vue3-dayjs-plugin

A wrapper for integrating dayjs into Vuejs 3

10,882 1
dayjs-nuxt

Day.JS Module for Nuxt

1,986,864 126
@dracul/dayjs-frontend

vue dayjs utils

3,079 4

Version History

Version Released License
0.1.2 MIT
0.1.1 MIT
0.1.0 MIT