From 74cc2bf338cf3b785ddc7d69636ae5cb05d89e1e Mon Sep 17 00:00:00 2001 From: Vincent GS Date: Mon, 22 Apr 2024 09:08:49 -0600 Subject: [PATCH] feat(VNavigationDrawer): add new persistent prop (#19552) --- .../components/VNavigationDrawer/VNavigationDrawer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vuetify/src/components/VNavigationDrawer/VNavigationDrawer.tsx b/packages/vuetify/src/components/VNavigationDrawer/VNavigationDrawer.tsx index da15eeb5104..35b0722bdcf 100644 --- a/packages/vuetify/src/components/VNavigationDrawer/VNavigationDrawer.tsx +++ b/packages/vuetify/src/components/VNavigationDrawer/VNavigationDrawer.tsx @@ -71,6 +71,7 @@ export const makeVNavigationDrawerProps = propsFactory({ }, image: String, temporary: Boolean, + persistent: Boolean, touchless: Boolean, width: { type: [Number, String], @@ -132,6 +133,7 @@ export const VNavigationDrawer = genericComponent()({ const location = computed(() => { return toPhysical(props.location, isRtl.value) as 'left' | 'right' | 'bottom' }) + const isPersistent = computed(() => props.persistent) const isTemporary = computed(() => !props.permanent && (mobile.value || props.temporary)) const isSticky = computed(() => props.sticky && @@ -225,6 +227,7 @@ export const VNavigationDrawer = genericComponent()({ 'v-navigation-drawer--is-hovering': isHovering.value, 'v-navigation-drawer--rail': props.rail, 'v-navigation-drawer--temporary': isTemporary.value, + 'v-navigation-drawer--persistent': isPersistent.value, 'v-navigation-drawer--active': isActive.value, 'v-navigation-drawer--sticky': isSticky.value, }, @@ -297,7 +300,10 @@ export const VNavigationDrawer = genericComponent()({
isActive.value = false } + onClick={ () => { + if (isPersistent.value) return + isActive.value = false + }} { ...scopeId } /> )}