new Date() //方法 可以获取当前的时间
new Date('可以传入指定的时间') //方法里面可以传入指定的时间,用来改造时间的格式等
new Date().getTime() + 24 * 60 * 60 * 1000 //可以获取到后一天的时间 24改成48可以获取到当前时间后两天的时间
//day.js 这个插件有个format方法可以修改日期的格式
例如: this.$dayjs(new Date()).format('YYYY年MM月DD日') //format()方法里面表示想要修改的时间格式
//this.$dayjs是全局引入过的写法,在main.js文件内 全局引入
例如: // 时间插件
import dayjs from 'dayjs'
//挂在到原型
Vue.prototype.$dayjs = dayjs
//以上全局引入,在页面中就可以 this.$dayjs 使用,使用day.js,需要npm下载依赖
day.js地址:https://day.js.org/docs/zh-CN/durations/format#docsNav