update active note

This commit is contained in:
2023-05-13 07:29:27 +02:00
parent f96d139b55
commit 9b75843a9d
6 changed files with 19 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { rootNote, notes, activeNote } from '@/composables/useNotes'
import { rootNote, notes, setActiveNote } from '@/composables/useNotes'
const props = defineProps<{
viewModes: ViewMode[]
@@ -20,7 +20,7 @@ const emit = defineEmits<{
<template #items>
<SideBarMenuItem
icon="fas fa-fw fa-home"
@click="activeNote = rootNote"
@click="setActiveNote(rootNote?.id)"
:title="rootNote?.title"
>
{{ rootNote?.title }}
@@ -49,7 +49,7 @@ const emit = defineEmits<{
<SideBarMenuItem
v-for="note in notes"
icon="far fa-file-alt fa-fw"
@click="activeNote = note"
@click="setActiveNote(note.id)"
:title="rootNote?.title"
>
{{ note.title }}