Skip to main content

getEditorItems

Factory that returns a fresh array of the default Editor field definitions: a text input plus start, end, and all-day fields. Use it as a starting point when building a custom items list so the built-in fields are preserved without retyping their config.

Usage

getEditorItems(): EditorItem[];

A new array is returned on each call.

Default fields

compkeylabelExtra config
texttextText-
date-time-pickerstartStart datetime: true, config: { buttons: false }
date-time-pickerendEnd datetime: true, config: { buttons: false }
checkboxallDayAll day-

Example

Spread the defaults and append custom fields:

<script setup lang="ts">
import { Calendar, Editor, getEditorItems, registerEditorItem } from "@wx/vue-calendar";
import { Comments } from "@wx/vue-comments";
import { ref } from "vue";

registerEditorItem("comments", Comments);

const items = [
...getEditorItems(),
{
comp: "comments",
key: "comments",
label: "Comments",
users,
activeUser: 1,
},
];

const api = ref(null);
</script>

<template>
<Calendar ref="api" :events="events" />
<Editor v-if="api" :api="api" :items="items" />
</template>
  • registerEditorItem — bind a Vue component (SFC) to a custom comp id.
  • Editor — companion that consumes this items array.
  • Editing — patterns for extending and replacing editor fields.