mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 14:30:52 +01:00
fixed sync locale and theme
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="dropdown relative inline-flex">
|
||||
<div class="dropdown relative inline-flex" :class="dropdownClass">
|
||||
<button
|
||||
:id
|
||||
class="dropdown-toggle"
|
||||
@ -47,6 +47,7 @@ const { itemIs = 'li' } = defineProps<{
|
||||
items?: T[]
|
||||
itemIs?: string
|
||||
activatorClass?: string
|
||||
dropdownClass?: string
|
||||
}>()
|
||||
|
||||
defineEmits<{ select: [T] }>()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<fieldset class="join w-full">
|
||||
<fieldset class="join w-full pt-0.5">
|
||||
<slot name="prepend" />
|
||||
|
||||
<div class="input join-item">
|
||||
|
||||
@ -1,33 +1,12 @@
|
||||
<template>
|
||||
<aside
|
||||
class="flex shrink-0 transition-[width] ease-in duration-300 z-30 h-full overflow-hidden fixed sm:relative left-0 shadow border-r border-base-300"
|
||||
class="flex shrink-0 transition-[width] ease-in duration-300 z-30 h-full overflow-hidden fixed sm:relative left-0 shadow border-r border-base-300/90"
|
||||
>
|
||||
<div class="sm:flex flex-col w-14 bg-base-200 shrink-0 h-full hidden">
|
||||
<img src="/logo.svg" class="bg-primary p-3 size-16" />
|
||||
|
||||
<div class="flex flex-col justify-between h-full overflow-y-scroll z-10">
|
||||
<div class="flex flex-col space-y-2 text-base-content/90">
|
||||
<template v-for="item in menu.top">
|
||||
<UiSidebarLink v-if="item.to" v-bind="item" />
|
||||
|
||||
<UiSidebarButton v-else :icon="item.icon" :label="$t(item.label)" @click="item.click" />
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col space-y-2 text-base-content/90">
|
||||
<template v-for="item in menu.bottom">
|
||||
<UiSidebarLink v-if="item.to" v-bind="item" />
|
||||
|
||||
<UiSidebarButton v-else :icon="item.icon" :label="$t(item.label)" @click="item.click" />
|
||||
</template>
|
||||
<!-- <UiSidebarLink
|
||||
v-for="item in menu.bottom"
|
||||
:icon="item.icon"
|
||||
:to="item.to ?? ''"
|
||||
:label="item.label"
|
||||
@click="item.click"
|
||||
/> -->
|
||||
</div>
|
||||
<div class="flex flex-col space-y-2 text-base-content/90"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -76,11 +55,8 @@
|
||||
<script lang="ts" setup>
|
||||
defineProps({
|
||||
menu: {
|
||||
type: Object as PropType<ISidebarMenu>,
|
||||
type: Object as PropType<ISidebarItem>,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
//const show = ref(true);
|
||||
const { show } = storeToRefs(useSidebarStore());
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<li
|
||||
@click="triggerNavigate"
|
||||
class="hover:text-primary rounded"
|
||||
:class="{ ['bg-base-300']: isActive }"
|
||||
:class="{ ['bg-base-200 text-base-content']: isActive }"
|
||||
>
|
||||
<UiTooltip :tooltip="tooltip ?? name" direction="right-start">
|
||||
<NuxtLinkLocale
|
||||
@ -18,24 +18,27 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type ISidebarItem } from "#imports";
|
||||
import { type ISidebarItem } from '#imports'
|
||||
|
||||
const props = defineProps<ISidebarItem>();
|
||||
const props = defineProps<ISidebarItem>()
|
||||
|
||||
const router = useRouter();
|
||||
const router = useRouter()
|
||||
|
||||
console.log("to", props.to);
|
||||
console.log('to', props.to)
|
||||
const isActive = computed(() => {
|
||||
if (props.to?.name === "haexExtension") {
|
||||
return getSingleRouteParam(router.currentRoute.value.params.extensionId) === props.id;
|
||||
if (props.to?.name === 'haexExtension') {
|
||||
return (
|
||||
getSingleRouteParam(router.currentRoute.value.params.extensionId) ===
|
||||
props.id
|
||||
)
|
||||
} else {
|
||||
return props.to?.name === router.currentRoute.value.meta.name;
|
||||
return props.to?.name === router.currentRoute.value.meta.name
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
const linkRef = useTemplateRef("linkRef");
|
||||
const linkRef = useTemplateRef('linkRef')
|
||||
|
||||
const triggerNavigate = () => linkRef.value?.$el.click();
|
||||
const triggerNavigate = () => linkRef.value?.$el.click()
|
||||
|
||||
/* computed(() => {
|
||||
const found = useRouter()
|
||||
|
||||
Reference in New Issue
Block a user