fix sidebar warren buttons
This commit is contained in:
@@ -15,6 +15,13 @@ import {
|
||||
const route = useRoute();
|
||||
|
||||
const store = useWarrenStore();
|
||||
|
||||
async function selectWarren(id: string) {
|
||||
await store.setCurrentWarren(id, '/');
|
||||
await navigateTo({
|
||||
path: '/warrens/files',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -46,25 +53,20 @@ const store = useWarrenStore();
|
||||
<CollapsibleContent>
|
||||
<SidebarMenuSub>
|
||||
<SidebarMenuSubItem
|
||||
v-for="(warren, uuid) in store.warrens"
|
||||
:key="uuid"
|
||||
v-for="(warren, id) in store.warrens"
|
||||
:key="id"
|
||||
>
|
||||
<SidebarMenuSubButton
|
||||
as-child
|
||||
:tooltip="warren.name"
|
||||
:is-active="
|
||||
route.path.startsWith(
|
||||
`/warrens/${uuid}`
|
||||
)
|
||||
store.current != null &&
|
||||
store.current.warrenId === id
|
||||
"
|
||||
class="transition-all"
|
||||
@click="() => selectWarren(id)"
|
||||
>
|
||||
<NuxtLink :to="`/warrens/${uuid}`">
|
||||
<Icon
|
||||
name="lucide:folder-root"
|
||||
/>
|
||||
<Icon name="lucide:folder-root" />
|
||||
<span>{{ warren.name }}</span>
|
||||
</NuxtLink>
|
||||
</SidebarMenuSubButton>
|
||||
</SidebarMenuSubItem>
|
||||
</SidebarMenuSub>
|
||||
|
||||
Reference in New Issue
Block a user