How to implement “Clear” button in vue2-daterange-picker?

Viewed 654
1 Answers

This worked for me:

Your button needs to update the dateRange object or rather 'reset' it to the default in this case.

Button

<button class="btn btn-info" @click="clearDate()" type="button"> Clear </button>

Methods

methods:{
    clearDate() {
        this.dateRange.startDate = null;
        this.dateRange.endDate = null;
    },
}

I am new to all this stuff, and I realise my response is some months after the question, but I hope that it helps.

Related