refactor(components): remove unused loaded
injection from sidebar
This commit is contained in:
parent
294b1b0602
commit
cb2d4328a8
@ -5,8 +5,6 @@
|
|||||||
import { ISidebarItem } from "@models/sidebarEntry";
|
import { ISidebarItem } from "@models/sidebarEntry";
|
||||||
import { NuxtLink } from "#components";
|
import { NuxtLink } from "#components";
|
||||||
|
|
||||||
const loaded = inject<Ref<boolean>>("loaded");
|
|
||||||
|
|
||||||
const { useToken } = theme;
|
const { useToken } = theme;
|
||||||
const { token } = useToken();
|
const { token } = useToken();
|
||||||
|
|
||||||
@ -14,7 +12,7 @@
|
|||||||
|
|
||||||
const { data: injecto } = await useApiFetch<ISidebarItem[]>("/sidebar");
|
const { data: injecto } = await useApiFetch<ISidebarItem[]>("/sidebar");
|
||||||
|
|
||||||
let items: Ref<ItemType[]> = ref([
|
let items = reactive<ItemType[]>([
|
||||||
{
|
{
|
||||||
key: "important",
|
key: "important",
|
||||||
label: h("span", { class: "smallcaps" }, ["Pinned"]),
|
label: h("span", { class: "smallcaps" }, ["Pinned"]),
|
||||||
@ -79,26 +77,23 @@
|
|||||||
// console.log("wtf", items)
|
// console.log("wtf", items)
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<client-only>
|
<!-- <client-only>-->
|
||||||
<a-menu
|
<a-menu
|
||||||
mode="inline"
|
mode="inline"
|
||||||
@select="
|
@select="
|
||||||
({ item, key, selectedKeys }) => {
|
({ item, key, selectedKeys }) => {
|
||||||
if ((key as string).startsWith('/')) {
|
if ((key as string).startsWith('/')) {
|
||||||
selState = key as string;
|
selState = key as string;
|
||||||
navigateTo(key as string);
|
navigateTo(key as string);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"
|
}
|
||||||
:style="{
|
"
|
||||||
flexGrow: 0.8,
|
:trigger-sub-menu-action="'click'"
|
||||||
}"
|
v-model:active-key="selState"
|
||||||
:trigger-sub-menu-action="'click'"
|
:items="items"
|
||||||
v-model:active-key="selState"
|
:inline-indent="16"
|
||||||
:items="items"
|
>
|
||||||
:inline-indent="16"
|
<!-- <a-sub-menu>
|
||||||
>
|
|
||||||
<!-- <a-sub-menu>
|
|
||||||
<template #title>
|
<template #title>
|
||||||
<sidebar-icon>
|
<sidebar-icon>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@ -126,8 +121,8 @@
|
|||||||
</sidebar-icon>
|
</sidebar-icon>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-sub-menu> -->
|
</a-sub-menu> -->
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</client-only>
|
<!-- </client-only>-->
|
||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.smallcaps {
|
.smallcaps {
|
||||||
|
Loading…
Reference in New Issue
Block a user