获取年份数组 默认5年
/* 获取年份数组 默认5年*/
export function getYear(num = 5) {
const curYear = new Date().getFullYear()
let arr = []
for (let i = curYear; i > curYear - num; i--) {
arr.push({
itemId: i,
itemText: i
})
}
return arr
}
/* 获取年份数组 默认5年*/
export function getYear(num = 5) {
const curYear = new Date().getFullYear()
let arr = []
for (let i = curYear; i > curYear - num; i--) {
arr.push({
itemId: i,
itemText: i
})
}
return arr
}