From 6dea920712db04d88b6b47822f86914d782671c9 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Thu, 5 Sep 2024 14:48:26 +0300 Subject: [PATCH] nav --- front/src/assets/nav.scss | 1 + front/src/components/nav.vue | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/front/src/assets/nav.scss b/front/src/assets/nav.scss index 6b40ee4..86ffcd9 100644 --- a/front/src/assets/nav.scss +++ b/front/src/assets/nav.scss @@ -38,6 +38,7 @@ $white: #fff; a[href].router-link-active { color: $white; line-height: 0; + text-decoration: none; } &.active { diff --git a/front/src/components/nav.vue b/front/src/components/nav.vue index e4f2b42..808e27a 100644 --- a/front/src/components/nav.vue +++ b/front/src/components/nav.vue @@ -4,9 +4,25 @@ import icon_home from '../assets/btn/home.svg'; import icon_gallery from '../assets/btn/gallery.svg'; import { useRoute } from 'vue-router'; import { useItem } from '../stores/item'; +import { onMounted, ref } from 'vue'; +import { SERVER_URL } from '../constants'; const route = useRoute() const pageStore = useItem() + +const items = ref([] as { name: string, slug: string }[]) + +onMounted(async () => { + const res = await fetch(`${SERVER_URL}/api/item/`) + const data = await res.json() + + data.forEach((element: any) => { + items.value.push({ + name: element.name, + slug: element.slug, + }) + }); +}) \ No newline at end of file