Files
heroui-vue/apps/docs/demos/range-calendar-weeks-in-month.vue
T

38 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// Adapted from HeroUI ce90ea3 range-calendar/weeks-in-month.tsx, Apache-2.0.
import {
RangeCalendar,
RangeCalendarHeader,
RangeCalendarHeading,
RangeCalendarNavButton,
RangeCalendarGrid,
RangeCalendarGridHeader,
RangeCalendarGridBody,
RangeCalendarHeaderCell,
RangeCalendarCell,
Description,
} from "@heroui-vue/components";
</script>
<template>
<div class="flex flex-col items-center gap-4">
<RangeCalendar aria-label="行程日期" :weeks-in-month="6">
<RangeCalendarHeader>
<RangeCalendarHeading />
<RangeCalendarNavButton slot="previous" />
<RangeCalendarNavButton slot="next" />
</RangeCalendarHeader>
<RangeCalendarGrid>
<RangeCalendarGridHeader v-slot="{ day }">
<RangeCalendarHeaderCell>{{ day }}</RangeCalendarHeaderCell>
</RangeCalendarGridHeader>
<RangeCalendarGridBody v-slot="{ date }">
<RangeCalendarCell :date="date" />
</RangeCalendarGridBody>
</RangeCalendarGrid>
</RangeCalendar>
<Description class="text-center">
每月固定显示 6 周,切换月份时避免布局跳动
</Description>
</div>
</template>