Skip to content

Commit

Permalink
feat(NcAppSidebar): add noToggle prop to hide the built-in toggle button
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed Jun 14, 2024
1 parent 27dbb98 commit 7195908
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/NcAppSidebar/NcAppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export default {
</docs>

<template>
<NcButton v-if="!open"
<NcButton v-if="!open && !noToggle"
ref="toggle"
:aria-label="t('Open sidebar')"
class="app-sidebar__toggle"
Expand Down Expand Up @@ -764,10 +764,10 @@ export default {
/**
* Allow to conditionally show the sidebar
* You can also use `v-if` on the sidebar, but using the open prop allow to keep
* the sidebar inside the DOM for performance if it is opened and closed multple times.
* the sidebar inside the DOM for performance if it is opened and closed multiple times.
*
* When using the `open` property to close the sidebar a built-in toggle button will be shown to reopen it,
* similar to the app navigation.
* similar to the app navigation. You can remove this button with the `no-toggle` prop.
*/
open: {
type: Boolean,
Expand All @@ -790,6 +790,14 @@ export default {
type: Object,
default: undefined,
},
/**
* Do not add the built-in toggle button with `open` prop.
*/
noToggle: {
type: Boolean,
default: false,
},
},
emits: [
Expand Down

0 comments on commit 7195908

Please sign in to comment.