[Vuejs]-Can't get the value of Date Range Picker (Vuejs)

3👍

For v-model to work, a component needs to have a prop called value and emit an input event.

VueRangedatePicker doesn’t have that prop or event. Instead, it emits a selected event when it updates. You can listen for it using @selected. For example:

<VueRangedatePicker @selected="updateDatePicker"></VueRangedatePicker>
  methods: {
    showdata() {
      console.log("DATE PICKER", this.datepicker);
      console.log("start: " + this.datepicker.start);
      console.log("end: " + this.datepicker.end);
    },
    updateDatePicker(value) {
      console.log("updating datepicker value");
      this.datepicker = value;
    }

See updated code here.

Leave a comment