ant 年份选择器
<a-date-picker v-model="yearValue" mode="year" format="YYYY" value-format="YYYY" style="width: 100px" :open="yearShowOne" :allow-clear="false" :disabled-date="(current) => current && current.isBefore('2022')" @openChange="openChangeOne" @panelChange="panelChangeOne" > <a-icon slot="suffixIcon" /> </a-date-picker>
// 弹出日历和关闭日历的回调 openChangeOne(status) {this.yearShowOne = status }, // 得到年份选择器的值 panelChangeOne(value) { this.yearShowOne = false this.yearValue = moment(value).format('YYYY') }