Browse Source

Merge pull request #4545 from nocodb/fix/sidebar-refresh

fix: improved refresh sidebar logic
pull/3668/head
Raju Udava 2 years ago committed by GitHub
parent
commit
260a188bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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