Ga naar hoofdinhoud

CnNoteComposer

The shared input for writing a note, used by CnNotesTab (the sidebar Notes tab) and CnNotesCard (the detail-page card).

  • Mentions. Typing @ suggests users and groups, from Nextcloud's own autocomplete, so the instance's sharing restrictions apply. A group is stored as @"group/<gid>", the format Nextcloud Comments and Talk use, and shown as a group chip.
  • Images. An image (image/*) pasted or dropped into the box is uploaded to the record's files (POST .../{id}/filesMultipart) and its reference, ![name](url), is added to the end of the note. Other file types are left alone. Without a record (register, schema and objectId) paste does nothing new. A failed upload says so and leaves the note as it was.
  • Ctrl or Cmd + Enter emits submit.

Usage​

<CnNoteComposer v-model="text" register="tasks" schema="task" objectId="T1" @submit="save" />

Props​

PropTypeDefaultDescription
modelValueString''The note text (v-model).
placeholderString"Write a note…"Placeholder shown while the box is empty.
registerString''Register slug of the record the note belongs to, for image upload.
schemaString''Schema slug of the record.
objectIdString''Id of the record.
apiBaseString/apps/openregister/apiBase URL of the OpenRegister API.

Events​

EventPayloadDescription
update:modelValueStringThe text changed, including when an image reference was added.
submitnoneCtrl or Cmd + Enter was pressed.
uploaded{ name, url }An image was uploaded to the record's files.

Slots​

None.