From 12a6757df3e15d7f33d75a9c70aff52b5051f5f5 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 14 Dec 2023 20:12:27 +0100 Subject: [PATCH] Use NuxtUI tabs for my talents and bookmarks page --- src/pages/bookmarks.vue | 40 +++++++++++++++++++--------------------- src/pages/talents.vue | 41 +++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 41 deletions(-) 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 }} -

-
-
+
+ + +