update note content
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user