<a-range-picker
:mode="mode2"
format="YYYY-MM"
v-model="yaerMode"
:open="yearShowOne"
@openChange="openChangeOne"
@panelChange="panelChangeOne"
/>
import moment from 'moment'
mode2:['month', 'month'],
yearShowOne:false,
yaerMode:[] ,
watch: {
yaerMode(newValue, oldValue) {
if(newValue.length == 0){
this.queryParam.releaseTimeStart = ''
this.queryParam.releaseTimeEnd = ''
}
}
},
openChangeOne(status){
this.yearShowOne = !this.yearShowOne
},
panelChangeOne(value){
this.yaerMode = value
this.queryParam.releaseTimeStart = moment(value[0]).format('YYYY-MM')
this.queryParam.releaseTimeEnd = moment(value[1]).format('YYYY-MM')
this.yearShowOne = !this.yearShowOne
},
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/92b4f7f94f7cc250972d744310c423f4.jpeg#pic_center)