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