From 14d9d12e5baa4492cb419bfa17fd3d10536d20a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Fri, 1 Dec 2023 17:58:12 -0500 Subject: [PATCH] fix(components): make navbar show up properly --- components/layouts/navbar.vue | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/components/layouts/navbar.vue b/components/layouts/navbar.vue index 93242fd..7f0bf34 100644 --- a/components/layouts/navbar.vue +++ b/components/layouts/navbar.vue @@ -3,9 +3,9 @@ import { MenuProps } from "ant-design-vue"; const { data, status } = useAuth(); - const itemMap = { + const itemMap = ref({ home: "/", - bands: "bands", + bands: "/bands", authors: "/authors", forum: "/forum", account: "/my-stuff", @@ -17,18 +17,19 @@ profile: `/user/${data?.value?.user?._id || 0}`, admin: "/admin", logout: "/logout", - }; + }); let cur = ref( - Object.keys(itemMap).find((a) => itemMap[a] === useRoute().path) || - useRoute().path, + Object.keys(itemMap.value).find( + (a) => itemMap.value[a] === useRoute().path, + ) || useRoute().path, ); let selected: string[] = [cur.value]; const clickFn = (minfo) => { - if (itemMap[minfo.key] === undefined) return; - cur.value = itemMap[minfo.key]; + if (itemMap.value[minfo.key] === undefined) return; + cur.value = itemMap.value[minfo.key]; selected = [cur.value]; - navigateTo(itemMap[minfo.key]); + navigateTo(itemMap.value[minfo.key]); }; console.log({ label: "client", value: cur.value, stat: status.value }); @@ -67,15 +68,14 @@
- + + Post a new Story