In order to detect changes performed by the Scheduler UI in Vue, you need to watch the source object. Like this:
<template>
<DayPilotScheduler
:events="events"
:resources="resources"
/>
</template>
<script setup>
import { DayPilotScheduler } from '@daypilot/daypilot-lite-vue';
import { ref, onMounted, watch } from 'vue';
const events = ref([]);
const resources = ref([]);
const loadEvents = () => {
events.value = [
{ id: 1, start: "2025-01-10T00:00:00", end: "2025-01-15T00:00:00", text: "Event 1", resource: "A" },
];
};
const loadResources = () => {
resources.value = [
{ id: "A", name: "Resource A" },
{ id: "B", name: "Resource B" },
// Add more resources as needed
];
};
watch(
events,
() => {
console.log("events.value", events.value);
},
{ deep: true }
);
onMounted(() => {
loadResources();
loadEvents();
});
</script>