Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-cli-plugin-dayjs

sy97176MIT0.1.2

Vue CLI 3 plugin to add dayjs to your vue project

vue, vue-cli-3, vue-cli-4, vue-cli-plugin, vue-plugins, dayjs, momentjs

readme

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 `html

<template>

{{ $day().format('DD-MM-YY hh:mma') }}

</template> ``` ```javascript // 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> ```