Fixed calendar grid not loading during refresh
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
import { useCalendar } from '@/stores/CalendarStore'
|
import { useCalendar } from '@/stores/CalendarStore'
|
||||||
import { useThrottleFn } from '@vueuse/core'
|
import { useThrottleFn } from '@vueuse/core'
|
||||||
|
|
||||||
const { currentDate, decrementMonth, incrementMonth, currentMonthData } = useCalendar()
|
const { currentDate, decrementMonth, incrementMonth } = useCalendar()
|
||||||
|
const { currentMonthData } = storeToRefs(useCalendar())
|
||||||
|
|
||||||
function handleWheel(e: WheelEvent) {
|
function handleWheel(e: WheelEvent) {
|
||||||
const isMovingUp = e.deltaY < 0
|
const isMovingUp = e.deltaY < 0
|
||||||
@@ -24,6 +25,7 @@ const moveCalendarRight = useThrottleFn(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="grid grid-cols-10" @wheel="handleWheel">
|
<div class="grid grid-cols-10" @wheel="handleWheel">
|
||||||
|
<template v-if="currentMonthData">
|
||||||
<CalendarStateMonthlyDayTile
|
<CalendarStateMonthlyDayTile
|
||||||
v-for="day in currentMonthData?.days"
|
v-for="day in currentMonthData?.days"
|
||||||
:key="`layout-month-grid-${day}`"
|
:key="`layout-month-grid-${day}`"
|
||||||
@@ -33,5 +35,6 @@ const moveCalendarRight = useThrottleFn(() => {
|
|||||||
year: currentDate.currentYear
|
year: currentDate.currentYear
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user