커스텀 버튼 추가

This commit is contained in:
dyhj625 2025-03-25 10:44:09 +09:00
parent 0636f74c9b
commit 33cd40038f

View File

@ -127,6 +127,19 @@ const hasChanges = computed(() => {
);
});
// (, , )
const moveCalendar = async (value = 0) => {
const calendarApi = fullCalendarRef.value?.getApi();
if (value === 1) {
calendarApi.prev(); //
} else if (value === 2) {
calendarApi.next(); //
} else if (value === 3) {
calendarApi.today(); //
}
};
/* 캘린더 설정 */
// ,
const calendarOptions = reactive({
@ -144,9 +157,17 @@ const calendarOptions = reactive({
datesSet: handleMonthChange,
events: calendarEvents,
customButtons: {
prev: {
text: 'PREV',
click: () => moveCalendar(1),
},
today: {
text: 'TODAY',
click: () => fullCalendarRef.value?.getApi().today(),
click: () => moveCalendar(3),
},
next: {
text: 'NEXT',
click: () => moveCalendar(2),
},
},
});