/** * 获取年月日 */ export function getYearAndMonthAndDays() { const date = new Date() let year = date.getFullYear() let month = date.getMonth() + 1 if (month < 10) { month = '0' + month + '-' } else { month = month + '-' } year = year + '-' let days = date.getDate() return year + month + days }