Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset selected date? #94

Open
mvalitov opened this issue Mar 10, 2020 · 2 comments
Open

reset selected date? #94

mvalitov opened this issue Mar 10, 2020 · 2 comments

Comments

@mvalitov
Copy link

How to reset the currently selected date range?

@TawsifKarim
Copy link

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
Copy link

macodev commented Jul 10, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants