Files
heroui-vue/apps/docs/demos/calendar-weeks-in-month.vue
T
2026-10-24 20:59:19 +08:00

37 lines
996 B
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">
import {
Calendar,
CalendarHeader,
CalendarHeading,
CalendarNavButton,
CalendarGrid,
CalendarGridHeader,
CalendarGridBody,
CalendarHeaderCell,
CalendarCell,
Description,
} from "@heroui-vue/components";
</script>
<template>
<div class="flex flex-col items-center gap-4">
<Calendar aria-label="活动日期" :weeks-in-month="6">
<CalendarHeader>
<CalendarHeading />
<CalendarNavButton slot="previous" />
<CalendarNavButton slot="next" />
</CalendarHeader>
<CalendarGrid>
<CalendarGridHeader v-slot="{ day }">
<CalendarHeaderCell>{{ day }}</CalendarHeaderCell>
</CalendarGridHeader>
<CalendarGridBody v-slot="{ date }">
<CalendarCell :date="date" />
</CalendarGridBody>
</CalendarGrid>
</Calendar>
<Description class="text-center">
每月固定显示 6 周,切换月份时避免布局跳动
</Description>
</div>
</template>