Basic Usage
The events can be passed in a couple of different ways. In this example we are loading them through an external API.
Interested to learn about the calendar view? Learn how to set up the range the agenda covers →
Demo
<script setup>
const myView = {
agenda: { type: 'month' }
}
onMounted(() => {
getJson(
'https://trial.mobiscroll.com/events/?vers=5',
(events) => {
myEvents.value = events
},
'jsonp'
)
})
</script>
<template>
<MbscEventcalendar :view="myView" :data="myEvents" />
</template>

SFC JSSFC TS
<script setup>
import {
getJson,
MbscEventcalendar,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref([])
const isToastOpen = ref(false)
const toastMessage = ref('')
const myView = {
agenda: { type: 'month' }
}
function handleEventClick(args) {
toastMessage.value = args.event.title
isToastOpen.value = true
}
onMounted(() => {
getJson(
'https://trial.mobiscroll.com/events/?vers=5',
(events) => {
myEvents.value = events
},
'jsonp'
)
})
</script>
<template>
<MbscEventcalendar :data="myEvents" :view="myView" @event-click="handleEventClick" />
<MbscToast :message="toastMessage" :isOpen="isToastOpen" @close="isToastOpen = false" />
</template>
<script setup lang="ts">
import {
getJson,
MbscEventcalendar,
MbscToast,
setOptions
} from '@mobiscroll/vue'
import type { MbscCalendarEvent, MbscEventcalendarView, MbscEventClickEvent } from '@mobiscroll/vue'
import { onMounted, ref } from 'vue'
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
})
const myEvents = ref<MbscCalendarEvent[]>([])
const isToastOpen = ref<boolean>(false)
const toastMessage = ref<string>('')
const myView: MbscEventcalendarView = {
agenda: { type: 'month' }
}
function handleEventClick(args: MbscEventClickEvent) {
toastMessage.value = args.event.title || ''
isToastOpen.value = true
}
onMounted(() => {
getJson(
'https://trial.mobiscroll.com/events/?vers=5',
(events: MbscCalendarEvent[]) => {
myEvents.value = events
},
'jsonp'
)
})
</script>
<template>
<MbscEventcalendar :data="myEvents" :view="myView" @event-click="handleEventClick" />
<MbscToast :message="toastMessage" :isOpen="isToastOpen" @close="isToastOpen = false" />
</template>