Browse Source

fix: improved refresh sidebar logic

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/4545/head
mertmit 2 years ago
parent
commit
3a54b96ed9
  1. 13
      packages/nc-gui/layouts/default.vue

13
packages/nc-gui/layouts/default.vue

@ -8,7 +8,18 @@ const { te, t } = useI18n()
const { hasSidebar } = useSidebar('nc-left-sidebar')
const refreshSidebar = ref(false)
useTitle(route.meta?.title && te(route.meta.title) ? `${t(route.meta.title)} | NocoDB` : 'NocoDB')
watch(hasSidebar, (val) => {
if (!val) {
refreshSidebar.value = true
nextTick(() => {
refreshSidebar.value = false
})
}
})
</script>
<script lang="ts">
@ -20,7 +31,7 @@ export default {
<template>
<div class="w-full h-full">
<Teleport :to="hasSidebar ? '#nc-sidebar-left' : null" :disabled="!hasSidebar">
<slot :key="$route.name" name="sidebar" />
<slot v-if="!refreshSidebar" name="sidebar" />
</Teleport>
<a-layout-content>

Loading…
Cancel
Save