fix(date-picker): undefined dayIndex (#2545)

This commit is contained in:
Malik-Jouda
2024-11-06 13:25:27 +02:00
committed by GitHub
parent bf580863af
commit ce955d24f1
2 changed files with 14 additions and 0 deletions

View File

@@ -32,6 +32,11 @@ const attrs = {
'is-dark': { selector: 'html', darkClass: 'dark' },
'first-day-of-week': 2
}
function onDayClick(_: any, event: MouseEvent): void {
const target = event.target as HTMLElement
target.blur()
}
</script>
<template>
@@ -40,11 +45,13 @@ const attrs = {
v-model.range="date"
:columns="2"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
<VCalendarDatePicker
v-else
v-model="date"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
</template>

View File

@@ -70,6 +70,11 @@ const attrs = {
'is-dark': { selector: 'html', darkClass: 'dark' },
'first-day-of-week': 2
}
function onDayClick(_: any, event: MouseEvent): void {
const target = event.target as HTMLElement
target.blur()
}
</script>
<template>
@@ -78,11 +83,13 @@ const attrs = {
v-model.range="date"
:columns="2"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
<VCalendarDatePicker
v-else
v-model="date"
v-bind="{ ...attrs, ...$attrs }"
@dayclick="onDayClick"
/>
</template>