vue-rangedate-picker icon indicating copy to clipboard operation
vue-rangedate-picker copied to clipboard

reset selected date?

Open mvalitov opened this issue 4 years ago • 2 comments

How to reset the currently selected date range?

mvalitov avatar Mar 10 '20 10:03 mvalitov

I am using it like this:

 <VueRangedatePicker v-if="!reset"></VueRangedatePicker>
............................
............................
data(){
  reset: false,
},
methods: {
  submitForm(){
    //form on submit success
    this.reset = true;
    setTimeout(()=>{  this.reset = false }, 100)
}
}

The idea here is rerendering the component

TawsifKarim avatar Apr 02 '20 07:04 TawsifKarim

You could also reset the component date object directly, via $refs:

this.$refs.rangedatepicker.$data.dateRange = {};

Where 'rangedatepicker' is the ref attribute set on the component.

macodev avatar Jul 10 '20 07:07 macodev