bliblidotcom / vue-rangedate-picker

Range date picker with simple usage
https://bliblidotcom.github.io/vue-rangedate-picker/demo/
MIT License
218 stars 123 forks source link

reset selected date? #94

Open mvalitov opened 4 years ago

mvalitov commented 4 years ago

How to reset the currently selected date range?

TawsifKarim commented 4 years ago

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

macodev commented 4 years ago

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.