mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Allow sidebar use panel collapse/expand instead of conditional rendering
This commit is contained in:
@@ -102,7 +102,6 @@ export const useAppearanceSettingsStore = defineStore(
|
|||||||
return ![
|
return ![
|
||||||
'friends-locations',
|
'friends-locations',
|
||||||
'friend-list',
|
'friend-list',
|
||||||
'charts',
|
|
||||||
'charts-instance',
|
'charts-instance',
|
||||||
'charts-mutual'
|
'charts-mutual'
|
||||||
].includes(currentRouteName);
|
].includes(currentRouteName);
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
</RouterView>
|
</RouterView>
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
|
|
||||||
<template v-if="isSideBarTabShow">
|
|
||||||
<ResizableHandle
|
<ResizableHandle
|
||||||
with-handle
|
with-handle
|
||||||
:class="[
|
:class="[
|
||||||
@@ -37,6 +36,7 @@
|
|||||||
'z-20 [&>div]:-translate-x-1/2'
|
'z-20 [&>div]:-translate-x-1/2'
|
||||||
]"></ResizableHandle>
|
]"></ResizableHandle>
|
||||||
<ResizablePanel
|
<ResizablePanel
|
||||||
|
ref="asidePanelRef"
|
||||||
:default-size="asideDefaultSize"
|
:default-size="asideDefaultSize"
|
||||||
:min-size="asideMinSize"
|
:min-size="asideMinSize"
|
||||||
:collapsed-size="0"
|
:collapsed-size="0"
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
<Sidebar></Sidebar>
|
<Sidebar></Sidebar>
|
||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
|
||||||
</ResizablePanelGroup>
|
</ResizablePanelGroup>
|
||||||
</SidebarInset>
|
</SidebarInset>
|
||||||
</SidebarProvider>
|
</SidebarProvider>
|
||||||
@@ -83,7 +82,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, onUnmounted, watch } from 'vue';
|
import { computed, nextTick, onUnmounted, ref, watch } from 'vue';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
@@ -172,6 +171,17 @@
|
|||||||
isSideBarTabShow
|
isSideBarTabShow
|
||||||
} = useMainLayoutResizable();
|
} = useMainLayoutResizable();
|
||||||
|
|
||||||
|
const asidePanelRef = ref(null);
|
||||||
|
|
||||||
|
watch(isSideBarTabShow, async (show) => {
|
||||||
|
await nextTick();
|
||||||
|
if (show) {
|
||||||
|
asidePanelRef.value?.expand();
|
||||||
|
} else {
|
||||||
|
asidePanelRef.value?.collapse();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => watchState.isLoggedIn,
|
() => watchState.isLoggedIn,
|
||||||
(isLoggedIn) => {
|
(isLoggedIn) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user