From 5c6cb84383a1669957b54540c546f6249b9acb47 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: Tue, 9 Jul 2024 20:39:49 -0400 Subject: [PATCH] refactor(components): sidebar looks and acts prettier now --- components/layouts/sidebar.vue | 97 ++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/components/layouts/sidebar.vue b/components/layouts/sidebar.vue index 161bef6..d3da535 100644 --- a/components/layouts/sidebar.vue +++ b/components/layouts/sidebar.vue @@ -3,6 +3,7 @@ import { ItemType, theme } from "ant-design-vue"; import Icon from "../icon.vue"; import { ISidebarItem } from "@models/sidebarEntry"; + import { NuxtLink } from "#components"; const { useToken } = theme; const { token } = useToken(); @@ -10,8 +11,8 @@ const selState = ref(""); const { data: injecto } = await useApiFetch("/sidebar"); - - let items = reactive([ + let custItems = computed(() => (injecto.value || ([] as ISidebarItem[])).sort((a, b) => a.index - b.index)); + /*let items = ref([ { key: "important", label: h("span", { class: "smallcaps" }, ["Pinned"]), @@ -57,27 +58,24 @@ name: "sparkles", size: 19, }), - children: (injecto.value || ([] as ISidebarItem[])) - .sort((a, b) => a.index - b.index) - .map((b) => ({ - key: b.url, - label: h( - "span", - { - "data-color": b.color, - class: "custom-side-item", - }, - [h(NuxtLink, { to: b.url }, [b.linkTitle])], - ), - })), + children: custItems.value.map((b) => ({ + key: b.url, + label: h( + "span", + { + "data-color": b.color, + class: "custom-side-item", + }, + [h(NuxtLink, { to: b.url }, [b.linkTitle])], + ), + })), } as SubMenuType, - ]); - - // console.log("wtf", items) + ]);*/ @@ -127,4 +129,7 @@ .smallcaps { font-variant: small-caps; } + #sidebar-menu ul { + height: 100%; + }