当前位置: 首页 > Web前端 > vue.js

获取年月YYYY-MM

时间:2023-03-31 19:44:49 vue.js

setDefaultValues(){returnnewPromise(resolve=>{constyear=moment().year()//momentmonth取值范围0~11,默认设置last月,不需要-1letmonth=moment().month()if(month===0){month=12}this.defaultMonth=moment(`${year}-${month}`,'YYYY-MM')this.queryParam.lineId=41this.queryParam.date=this.defaultMonth.format('YYYY-MM')resolve()})},