vue获取当天时间
// 在created中调用该方法获取时间timeVale是data里面定义的时间参数
getDate(){
let nowdata=new Date();
let year=nowdata.getFullYear();
let month=nowdata.getMonth()+1;
let date=nowdata.getDate();
let nowTime=year+'.';
if(month<10){
nowTime+='0'
}
nowTime+=month+'.'
if(date<10){
nowTime+='0'
}
nowTime+=date;
this.timeValue=nowTime
},