diff --git a/src/pages/bookmarks.vue b/src/pages/bookmarks.vue index bdb64f8..3850289 100644 --- a/src/pages/bookmarks.vue +++ b/src/pages/bookmarks.vue @@ -21,15 +21,20 @@ const { watch: [isFavorite, getCategory], }) -function isCategory(category: string) { - return getCategory.value === category -} - const { data: getCategories, } = await useFetch>('/api/categories', { method: 'GET', query: { type: 'BOOKMARK' } }) getCategories.value!.forEach((category: any) => categories.value.push({ label: category.name, slug: category.slug })) +const selected = computed({ + get() { + return categories.value.findIndex(category => getCategory.value === category.slug) || 0 + }, + set(index) { + setCategory(categories.value[index].slug || categories.value[0].slug) + }, +}) + const appConfig = useAppConfig() function getColor() { return `text-${appConfig.ui.primary}-500` @@ -46,26 +51,22 @@ function getColor() { You will find a selection of some of the most inspiring and complete content I have read through my research and work experience.

-
-
-
-

- {{ category.label }} -

-
-
+
+ + +