一、ant design of vue清空日期组件值
1、a-range-picker组件代码展示
动态绑定value
<a-range-picker
show-time
format="YYYY/MM/DD HH:mm:ss"
@change="onChangeItem"
style="width:90%"
:value="pickerValue"
/>
2、pickerValue初始化值为 [ ]
data() {
return {
pickerValue: [ ],
}
}
3、选择时间给pickerValue赋值datas
onChange (dates, dateStrings) {
this.pickerValue= dates
this.submit_time_start = dates[0].format('YYYY-MM-DD')
this.submit_time_end = dates[1].format('YYYY-MM-DD')
this.$refs.table.refresh()
},
4、在重置按钮事件设置 this.pickerValue=[ ];
resetForm () {
this.pickerValue= []
this.$refs.table.refresh()
}