feat: migrate Calendar and calendar year picker
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
Calendar,
|
||||
CalendarHeader,
|
||||
CalendarHeading,
|
||||
CalendarNavButton,
|
||||
CalendarGrid,
|
||||
CalendarGridHeader,
|
||||
CalendarGridBody,
|
||||
CalendarHeaderCell,
|
||||
CalendarCell,
|
||||
} from "@heroui-vue/components";
|
||||
</script>
|
||||
<template>
|
||||
<Calendar
|
||||
aria-label="行程日期"
|
||||
:visible-duration="{ months: 2 }"
|
||||
class="@container-normal w-full max-w-none overflow-x-auto"
|
||||
>
|
||||
<div class="mx-auto flex w-max gap-8">
|
||||
<div class="w-64">
|
||||
<CalendarHeader>
|
||||
<CalendarHeading class="flex-none" />
|
||||
<CalendarNavButton slot="previous" />
|
||||
<div class="size-6" />
|
||||
</CalendarHeader>
|
||||
<CalendarGrid>
|
||||
<CalendarGridHeader v-slot="{ day }">
|
||||
<CalendarHeaderCell>{{ day }}</CalendarHeaderCell>
|
||||
</CalendarGridHeader>
|
||||
<CalendarGridBody v-slot="{ date }">
|
||||
<CalendarCell :date="date" />
|
||||
</CalendarGridBody>
|
||||
</CalendarGrid>
|
||||
</div>
|
||||
<div class="w-64">
|
||||
<CalendarHeader>
|
||||
<CalendarHeading class="flex-none" :offset="{ months: 1 }" />
|
||||
<div class="size-6" />
|
||||
<CalendarNavButton slot="next" />
|
||||
</CalendarHeader>
|
||||
<CalendarGrid :offset="{ months: 1 }">
|
||||
<CalendarGridHeader v-slot="{ day }">
|
||||
<CalendarHeaderCell>{{ day }}</CalendarHeaderCell>
|
||||
</CalendarGridHeader>
|
||||
<CalendarGridBody v-slot="{ date }">
|
||||
<CalendarCell :date="date" />
|
||||
</CalendarGridBody>
|
||||
</CalendarGrid>
|
||||
</div>
|
||||
</div>
|
||||
</Calendar>
|
||||
</template>
|
||||
Reference in New Issue
Block a user