修改年份展示2

This commit is contained in:
dong.ai
2025-09-12 13:44:19 +08:00
parent 2bca84c9ee
commit 0908f2d4f2

View File

@@ -573,15 +573,18 @@ export default defineComponent({
// 初始化年份选项
const initializeYearOptions = async () => {
// const currentYear = new Date().getFullYear();
const years = [];
// for (let i = currentYear; i >= 2000; i--) {
// years.push({ label: `${i}`, value: i.toString() });
// }
let res = await getExquisiteYearList({})
console.log("获取年份", res);
// .map((value) => {
// years.push({ label: `${value.name}`, value: value.id.toString() });
// })
state.yearOptions =res.data.data.result;
res.data.data.result.map((value) => {
years.push({ label: `${value.name}`, value: value.id.toString() });
})
console.log(years, '年份');
state.yearOptions = years;
};
//内容分类