update note content

This commit is contained in:
2023-05-13 08:09:52 +02:00
parent 69cec28fb6
commit 8eb7e57203
6 changed files with 85 additions and 8 deletions

View File

@@ -20,13 +20,15 @@ const emit = defineEmits<{
const noteTitle = ref(props.note.title)
watch(noteTitle, () => {
const updatedNote: Note = {
...props.note,
title: noteTitle.value,
}
const updatedNote: Note = { ...props.note, title: noteTitle.value }
emit('update', updatedNote)
})
const updateNoteContent = (content: string) => {
const updatedNote: Note = { ...props.note, content }
emit('update', updatedNote)
}
const references = computed<Note[]>(() => {
const relations = notesRelations.value[props.note.id]
return relations
@@ -67,6 +69,7 @@ const setRoot = async (closeModal: () => Promise<Boolean>) => {
<NoteEditor
class="h-100 flex-1 overflow-auto"
:note="activeNote"
@update="updateNoteContent"
v-if="activeNote"
/>
<NoteReferences :references="references" />