kenhyuwa / litepie-datepicker

Litepie Datepicker is a date range picker component for Vue.js and Tailwind CSS, dependent to day.js.
https://litepie.com
MIT License
373 stars 75 forks source link

Events #39

Open leandro2219 opened 3 years ago

leandro2219 commented 3 years ago

Hi, I am using this plugin in order to select a date and a range, but I need to get when use select a date (or range) and when It clicks on apply and cancel button. Is this possible?

Thanks.

kenhyuwa commented 3 years ago

do you mean props auto-apply?

leandro2219 commented 3 years ago

Hi, I mean, if there is a way than this component emit an event when user select a date or when clicks on Apply or Cancel Button.

Ej: @click="$emit('select', $event)"

Thanks.

sdoerger commented 3 years ago

Indeed, I mean, that is mostly the point to use a datepicker. Yes, I get the dates in my component, but I need to the dates to its parent component.

Emilien-Lambert commented 2 years ago

I have the same need, has anyone found a solution?

mustafakucuk commented 2 years ago

Hi,

Maybe you want use this way.

import { ref, watch } from "vue";
const dateValue = ref([]);

watch(
  dateValue,
  (val) => {
    console.log(val);
  },
  { deep: true }
);
jonhenning commented 1 year ago

I believe this is what you are looking for <litepie-datepicker @update:modelValue="$emit('select', $event)"