refacto to use ref route query

This commit is contained in:
Julien Calixte
2023-08-15 01:08:08 +02:00
parent 11831e1ca6
commit 43b99eed52
9 changed files with 94 additions and 125 deletions

View File

@@ -1,14 +1,14 @@
import { useTitle } from '@vueuse/core'
import { computed, Ref, toValue, watch } from 'vue'
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
import { useNotes } from '@/modules/note/hooks/useNotes'
import { pathToNoteTitle } from '@/utils/noteTitle'
export const generateTitle = (titles: string[]) => titles.join(' | ')
export const useTitleNotes = (prefix: Ref<string> | string) => {
const { stackedNotes } = useQueryStackedNotes()
const { stackedNotes } = useRouteQueryStackedNotes()
const { notes } = useNotes()
const titleNotes = computed(() =>
notes.value