getDateTime() {
this.dataTime.dateYear = formatTime(new Date(), “yyyy-MM-dd”);
this.dataTime.dateWeek = this.dataTime.weekday[new Date().getDay()];
this.dataTime.dateDay = formatTime(new Date(), “HH: mm: ss”);
setTimeout(() => {
this.getDateTime(); //在 函数里面写 setTimeout 调用函数本身 就会实现setInterval的效果
}, 1000);
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...


