只能选择今年和去年
<el-date-picker style="width: 100%;" v-model="sgcxForm.year" size="small" type="year" value-format="yyyy" :picker-options="pickerOptions0" placeholder="选择年"> </el-date-picker>pickerOptions0: { disabledDate(time) { return time.getFullYear() > new Date().getFullYear() || time.getFullYear() < new Date().getFullYear() - 1 } },
效果
标签:getFullYear,element,选择,日期,设置,time,Date,new From: https://www.cnblogs.com/hzx-5/p/17317735.html