export const mixinTime = {
data() {
return {
startTime: "",//开始时间
endTime: "",//结束时间
showTime: "", //展示的时间
mydate: "" //现在的时间,还没有格式化
};
},
methods: {
// 选择今天明天等
selectIndex(index) {
this.active = index;
if (this.active == 1) {
this.mydate = new Date();
let time = this.formatDate(this.mydate); //格式化当前时间
this.showTime = time + "今天";
this.startTime = time + " 00.00.00";
this.endTime = time + " 24:00:00";
} else if (this.active == 2) {
let newDate = new Date();
newDate.setDate(newDate.getDate() - 1);
let time2 = this.formatDate(newDate);
this.startTime = time2 + " 00:00:00";
this.endTime = time2 + " 24:00:00";
this.showTime = time2;
} else if (this.a
Vue 昨天 今天 明天 本月 上月 去年日期选择
最新推荐文章于 2023-11-19 15:21:36 发布