vue 引用 dayjs

npm 安装

npm install dayjs --save

main.js

import dayjs from "dayjs"
Vue.prototype.dayjs = dayjs;//可以全局使用dayjs

页面调用:

 console.log(this.dayjs().format('YYYY-MM-DD')); //2020-06-30

教程:https://www.jianshu.com/p/15d6a9c1bf18

你可能感兴趣的:(vue 引用 dayjs)