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%; + }