getDuration (date) {
// how many days of this month
let dt = new Date(date)
var month = dt.getMonth()
dt.setMonth(dt.getMonth() + 1)
dt.setDate(0);
return dt.getDate()
},
console.log(this.getDuration('2021-05')); //31天
如上