From 612fa756c1152a75626640451cb26ba1effff837 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 21 May 2024 18:03:15 +0200 Subject: [PATCH] fix(NcAppSidebar): make sidebar a single node to allow using v-show Signed-off-by: Grigorii K. Shartsev --- src/components/NcAppSidebar/NcAppSidebar.vue | 450 ++++++++++++------- src/components/NcContent/NcContent.vue | 1 + 2 files changed, 280 insertions(+), 171 deletions(-) diff --git a/src/components/NcAppSidebar/NcAppSidebar.vue b/src/components/NcAppSidebar/NcAppSidebar.vue index f259441acf..4a6afb92b7 100644 --- a/src/components/NcAppSidebar/NcAppSidebar.vue +++ b/src/components/NcAppSidebar/NcAppSidebar.vue @@ -354,14 +354,17 @@ A working alternative would be using an icon together with an `aria-label`: ``` -### Conditionally show the sidebar +### Conditionally show the sidebar with `open` -If the sidebar should be shown conditionally (e.g. using a button) -and the users are expected to open and close the sidebar multiple times, -then using `v-if` might result in bad performance. -So instead use the `open` property. +If the sidebar should be shown conditionally, you can use `open` prop to define sidebar visibility. +It automatically shows a toggle button to open the sidebar if it is closed. -You can also use `--app-sidebar-offset` CSS variable to preserve space for the toggle button, for example, in top bar of NcAppContent. +You can also use `--app-sidebar-offset` CSS variable to preserve space +for the toggle button, for example, in top bar of `NcAppContent`. + +The built-in toggle button can be removed with `no-toggle` prop. + +Note: the built-in toggle button is only available then NcAppSidebar is used in NcContent. ```vue