litepie-datepicker icon indicating copy to clipboard operation
litepie-datepicker copied to clipboard

Events

Open leandro2219 opened this issue 3 years ago • 6 comments

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.

leandro2219 avatar Aug 05 '21 19:08 leandro2219

do you mean props auto-apply?

kenhyuwa avatar Aug 07 '21 09:08 kenhyuwa

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.

leandro2219 avatar Aug 09 '21 10:08 leandro2219

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.

sdoerger avatar Sep 03 '21 08:09 sdoerger

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

Emilien-Lambert avatar Jun 07 '22 13:06 Emilien-Lambert

Hi,

Maybe you want use this way.

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

watch(
  dateValue,
  (val) => {
    console.log(val);
  },
  { deep: true }
);

mustafakucuk avatar Oct 04 '22 18:10 mustafakucuk

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

jonhenning avatar Oct 17 '22 14:10 jonhenning