Skip to main content

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;
ParameterTypeDescription
idstring | numberEvent 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>
  • getEvents — list events in a date range.
  • getState — full state snapshot including selected event.
  • events — the source array getEvent looks up against.