https://www.antdv.com/docs/vue/faq-cn/
代码实现:
当前需要对组件a-date-picker进行改造,如下: html:
<a-date-picker
mode="year"
format="YYYY"
:value="state.time"
:open="state.isopen"
placeholder="请选择年份"
@focus="changeopen"
@panelChange="handlePanelChange1">
</a-date-picker>
JS:
JavaScript
handlePanelChange1(value, mode) {
this.mode1 = mode
console.log(value);
console.log(mode);
this.state.time = value
this.state.isopen = false
},
changeopen() {
this.state.isopen = true;
}