RangePicker @calendarChange @change区别

<RangePicker
                      :bordered="false"
                      allowClear
                      :placeholder="['开始时间', '结束时间']"
                      @calendarChange="onCalenderChange"
                      @change="onRangeChange"
                    />

 

@calendarChange:只要点击了一个日期,就会触发。

@change:只有选择了二个日期才会触发。

 


  import { RangePickerValue } from 'ant-design-vue/lib/date-picker/interface';

const
onCalenderChange = (dates) => { let startdate = formatToDate(dates[0]); let enddate = formatToDate(dates[1]); console.log('onCalenderChange', startdate, enddate); } const onRangeChange = (date: RangePickerValue, dateString: [string, string]) => { console.log('change:', dateString[0], dateString[1]); };

 

 
posted @ 2022-05-31 11:09  jiduoduo  阅读(664)  评论(0编辑  收藏  举报