커스텀 버튼 추가
This commit is contained in:
parent
0636f74c9b
commit
33cd40038f
@ -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),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user