vue获取当前年月日

首先在方法里声明时间接收

addDate() {
                    nowDate = new Date();
                    let date = {
                        year: nowDate.getFullYear(),
                        month: nowDate.getMonth() + 1,
                        date: nowDate.getDate(),
                    }
                    console.log(date);
                    let systemDate = date.year + '-' + 0 + date.month + '-' + 0 + date.date;
                }

 

posted @ 2019-07-01 10:54  阳光‘  阅读(40280)  评论(1)    收藏  举报