mengxiong10 / vue2-datepicker

A datepicker / datetimepicker component for Vue2
https://mengxiong10.github.io/vue2-datepicker/index.html
MIT License
1.51k stars 405 forks source link

clear to given date #701

Closed gurupetach closed 2 years ago

gurupetach commented 2 years ago

When clearing(the x button), how can i set it to particular from and to instead of null?

mengxiong10 commented 2 years ago
<date-picker  v-model="value" @clear="handleClear"/>
handleClear() {
   this.value = [from, to]
}
gurupetach commented 2 years ago

Thanks. Also this works.. <date-picker v-model="params.range" type="date" value-type="format" format="YYYY-MM-DD" range placeholder="Filter by date range" @clear=" (clear) => { params.range = [(from = '2021-01-01'), (to = '')]; } " />