Vue Scheduler Props & Events

Props & events

The full CScheduler props, emitted events, and the template-ref API.

On this page

Props

<CScheduler v-bind="props" />
PropTypeDefaultDescription
agendaDaysnumber14Days shown (and stepped) by the agenda view.
businessHoursobject | nullnull{ daysOfWeek?, startHour, endHour, enforce? } — shades non-working time; enforce: true also rejects operations outside it.
dataSourceobject | nullnull{ getEvents(start, end), persistEvents? } — remote data.
datestring | Date | null—Controlled date of the visible range; unset or null leaves it uncontrolled. The scheduler shows it and asks for a new one through v-model:date.
dayStartHournumber0First visible hour of the time grid.
dayEndHournumber24Hour the time grid ends at (exclusive).
defaultDatestring | Date | nulltodayStart date when date is not set; the scheduler then navigates on its own.
defaultViewstring'week'Start view when view is not set.
eventsarray[]The events — see the event model.
eventOverlapbooleantruefalse rejects operations that would collide.
expandToFitbooleanfalseWiden events over adjacent free space.
firstDayOfWeeknumber1ISO weekday the week starts on.
hourHeightnumber48Pixels per hour in time-grid views.
labelsobject{}Overrides for the label set.
localestringbrowserBCP 47 locale for date/time formatting.
monthMaxEventsPerDaynumber4Chips per month cell before “+N more”.
recurringEditScopestring'occurrence'Initial scope for recurring edits: 'occurrence', 'future' or 'all'.
resourceColumnWidthnumber160Column width when the resource view virtualizes.
resourcesarray[]{ id, label?, color? } — columns of the resource view.
selectablebooleantrueAllow range-select creation and click selection.
snapnumber15Drag/resize/create step in minutes.
timeZonestringbrowserIANA zone all wall-clock math happens in.
timelineDaysnumber7Days covered by the timeline view.
timelineHourWidthnumber48Timeline horizontal zoom in pixels per hour.
viewstring—Controlled view: 'day', 'week', 'month', 'agenda', 'resource' or 'timeline'. The scheduler asks for a new one through v-model:view.

Events

EventPayloadFires on
dateChangedateNavigation (prev/next/today, more-link jumps, setDate()). With a controlled date the scheduler moves once the new date comes back.
eventChange{ action, event, occurrence, revert, scope }Create, move, resize, update, delete.
selectionChangeselectionClick selection changes.
viewChangeviewView switch (toolbar, more-link jumps, setView()). With a controlled view the scheduler switches once the new view comes back.
update:date, update:viewdate, viewSame moments as dateChange and viewChange, for v-model.

Template-ref API

The component exposes the imperative surface (CSchedulerRef) on its template ref:

MethodDescription
getEvents()Current events array (post-edits).
getSelection()Selected occurrence keys.
getVisibleRange()The visible window as { start, end } ISO strings.
navigate(direction)'prev', 'next' or 'today'; with a controlled date, asks through dateChange.
setDate(date)Move the anchor date; with a controlled date, ask for it as navigation does.
setEvents(events)Replace the events.
setView(view)Switch the view; with a controlled view, asks through viewChange.
<script setup lang="ts">
import { ref } from 'vue'
import { CScheduler, type CSchedulerRef } from '@coreui/vue-scheduler'

const scheduler = ref<CSchedulerRef | null>(null)
</script>

<template>
  <CScheduler ref="scheduler" :events="events" />
  <button @click="scheduler?.navigate('today')">Today</button>
</template>