here is my code :
<template
<nylas-editor-tabs :selectedConfiguration=“schedulerConfig” /
</template
script setup
import { ref, onMounted } from “vue”;
import { defineCustomElement } from “https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js”;
// Define the custom Nylas Web Elements
defineCustomElement();
const schedulerConfig = ref({
scheduling: {
scheduling_method: “single-host”, // Expected structure
max_book_ahead_days: 30, // Number of days ahead users can book
min_buffer_time: 15, // Minutes of buffer time between meetings
meeting_duration: 30 // Meeting duration in minutes
}
});
onMounted(() => {
console.log("Scheduler Config: ", schedulerConfig.value); // To inspect the data being passed
const schedulerEditor = document.querySelector(“nylas-editor-tabs”);
if (schedulerEditor) {
// Listen for the form submission event from the Nylas component
schedulerEditor.addEventListener("formSubmitted", (event) => {
console.log("Form submitted", event);
});
// Error handling
schedulerEditor.addEventListener("error", (error) => {
console.error("Nylas Scheduler Error:", error);
});
}
});