getEvent
Looks up an event in the calendar store by its id. Returns undefined when no event matches.
Usage
getEvent(id: string | number): CalendarEvent | undefined;
| Parameter | Type | Description |
|---|---|---|
id | string | number | Event id to look up |
Example
<script setup>
import { Calendar } from "@wx/vue-calendar";
import { ref } from "vue";
const api = ref(null);
function logEvent() {
const event = api.value.getEvent(42);
console.log(event);
}
</script>
<template>
<Calendar ref="api" :events="events" />
</template>