ć«ć¬ć³ćć¼ćććć¼
ć«ć¬ć³ćć¼ćććć¼ćÆćććć²ć¼ć·ć§ć³ć³ć³ććć¼ć«ć蔨示åćęæććę¤ē“¢ę©č½ćęä¾ćć¾ćććć®åä½ćć«ć¹ćæćć¤ćŗććććå®å Øć«ē½®ćęćććććććØćć§ćć¾ćć
ćććć¼ćé蔨示ć«ćć
ē¬čŖć®ććć²ć¼ć·ć§ć³ćę§ēÆćććå “åććććć©ć«ćć®ćććć¼ćäøč¦ćŖå “åćÆćē”å¹ć«ććććØćć§ćć¾ćć
const calendar = useCalendarApp({
views: [createMonthView()],
useCalendarHeader: false, // ććć©ć«ćć®ćććć¼ćé蔨示ć«ćć
});ć«ć¹ćæć ćććć¼
Breaking change from v3.4.1
useCalendarHeader
ćøć®é¢ę°ć®ęø”ććÆé対åæć«ćŖćć¾ććć仄äøć®ććć«ćć«ć¹ćæć ćććć¼ć
DayFlowCalendar ć® calendarHeader ć¹ćććć«ē§»č”ćć¦ćć ććć
calendarHeader ć³ć³ćć³ćć¹ćććć使ēØćć¦ćććć©ć«ćć®ćććć¼ćē¬čŖć®ć³ć³ćć¼ćć³ćć«ē½®ćęććććØćć§ćć¾ććć¬ć³ćć©ć¼ćÆć«ć¬ć³ćć¼ć®ē¶ę
ćØćć«ćć¼ć”ć½ćććåćåććććē¬čŖć® UI ććććć²ć¼ć·ć§ć³ćę¤ē“¢ćå¶å¾”ć§ćć¾ćć
import { useCalendarApp, DayFlowCalendar, createMonthView } from '@dayflow/react';
function MyCalendar() {
const calendar = useCalendarApp({
views: [createMonthView()],
});
return (
<DayFlowCalendar
calendar={calendar}
calendarHeader={() => (
<div className='custom-header'>
<button onClick={() => calendar.goToPrevious()}>ā¹</button>
<button onClick={() => calendar.goToToday()}>ä»ę„</button>
<button onClick={() => calendar.goToNext()}>āŗ</button>
</div>
)}
/>
);
}<template>
<DayFlowCalendar :calendar="calendar">
<template #calendarHeader="{ calendar }">
<div class="custom-header">
<button @click="calendar.goToPrevious()">ā¹</button>
<button @click="calendar.goToToday()">ä»ę„</button>
<button @click="calendar.goToNext()">āŗ</button>
</div>
</template>
</DayFlowCalendar>
</template>
<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createMonthView } from '@dayflow/core';
const calendar = useCalendarApp({
views: [createMonthView()],
});
</script>import { Component } from '@angular/core';
import { DayFlowCalendarModule } from '@dayflow/angular';
import { createMonthView } from '@dayflow/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [DayFlowCalendarModule],
template: `
<dayflow-calendar
[calendar]="calendar"
[calendarHeader]="customHeader"
>
</dayflow-calendar>
<ng-template #customHeader let-args>
<div class="custom-header">
<button (click)="args.calendar.goToPrevious()">ā¹</button>
<button (click)="args.calendar.goToToday()">ä»ę„</button>
<button (click)="args.calendar.goToNext()">āŗ</button>
</div>
</ng-template>
`
})
export class AppComponent {
calendar = {
views: [createMonthView()],
};
}<!-- App.svelte -->
<script lang="ts">
import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
import { createMonthView } from '@dayflow/core';
import CustomHeader from './CustomHeader.svelte';
const calendar = useCalendarApp({
views: [createMonthView()],
});
</script>
<DayFlowCalendar {calendar} calendarHeader={CustomHeader} />
<!-- CustomHeader.svelte -->
<script lang="ts">
import type { CalendarHeaderProps } from '@dayflow/core';
let { calendar } = $props<CalendarHeaderProps>();
</script>
<div class="custom-header">
<button onclick={() => calendar.goToPrevious()}>ā¹</button>
<button onclick={() => calendar.goToToday()}>ä»ę„</button>
<button onclick={() => calendar.goToNext()}>āŗ</button>
</div>ć¹ćććå¼ę°
ć¹ćććć¬ć³ćć©ć¼ćÆä»„äøć®å¼ę°ćåćåćć¾ćļ¼
| å¼ę° | čŖ¬ę |
|---|---|
calendar | CalendarApp ć¤ć³ć¹ćæć³ć¹ć |
switcherMode | ē¾åØć®č”Øē¤ŗåćęæćć¢ć¼ćļ¼buttons ć¾ć㯠selectļ¼ć |
onAddCalendar | ę°ććć«ć¬ć³ćć¼ćčæ½å ććććć®ćć³ćć©ć¼ć |
onSearchChange | ę¤ē“¢ćÆćØćŖćę“ę°ććććć®ćć³ćć©ć¼ć |
onSearchClick | ę¤ē“¢ć¢ć¤ć³ć³ććÆćŖććÆćććęć®ćć³ćć©ć¼ć |
searchValue | ē¾åØć®ę¤ē“¢ęååć |
isSearchOpen | ę¤ē“¢ UI ćē¾åØéćć¦ćććć©ććć |
isEditable | ć«ć¬ć³ćć¼ćē¾åØē·ØéåÆč½ćŖē¶ę ćć©ććć |
safeAreaLeft | macOS ć¢ć¼ćć§ćć©ćć£ććÆć©ć¤ćććæć³ćØéćŖććŖćććć®å·¦ä½ē½ļ¼pxļ¼ć |