update active note
This commit is contained in:
@@ -13,7 +13,7 @@ import ListPlugin from '@ckeditor/ckeditor5-list/src/list'
|
||||
import AutoformatPlugin from '@ckeditor/ckeditor5-autoformat/src/autoformat'
|
||||
import ContextedPlugin from '@/ckeditor/ContextedPlugin'
|
||||
import { mdToHtml } from '@/utils/markdown'
|
||||
import { activeNote, getNoteByTitle } from '@/composables/useNotes'
|
||||
import { getNoteByTitle, setActiveNote } from '@/composables/useNotes'
|
||||
import Autocomplete from '@/components/Autocomplete.vue'
|
||||
|
||||
const props = defineProps<{ note: Note }>()
|
||||
@@ -58,7 +58,7 @@ const editorElement = ref<HTMLInputElement | null>(null)
|
||||
const handleClick = ({ data }: { data: any }) => {
|
||||
const noteTitle = data.domTarget.textContent as string
|
||||
const note = getNoteByTitle(noteTitle)
|
||||
if (note) activeNote.value = note
|
||||
if (note) setActiveNote(note.id)
|
||||
}
|
||||
|
||||
const autocompleteRef = ref<InstanceType<typeof Autocomplete> | null>(null)
|
||||
|
||||
Reference in New Issue
Block a user