From ecd20647dd9dbea1c1bfcf27fbfd6a5e171c1763 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 27 Feb 2024 01:02:18 +0800 Subject: [PATCH] feat(theme): add `showOutline` prop to LocalNav --- theme/src/client/components/LocalNav.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/theme/src/client/components/LocalNav.vue b/theme/src/client/components/LocalNav.vue index f7e29265..ffec25ed 100644 --- a/theme/src/client/components/LocalNav.vue +++ b/theme/src/client/components/LocalNav.vue @@ -9,8 +9,9 @@ import { useSidebar, useThemeLocaleData } from '../composables/index.js' import IconAlignLeft from './icons/IconAlignLeft.vue' import LocalNavOutlineDropdown from './LocalNavOutlineDropdown.vue' -defineProps<{ +const props = defineProps<{ open: boolean + showOutline: boolean }>() defineEmits<(e: 'openMenu') => void>() @@ -42,6 +43,7 @@ const classes = computed(() => { 'fixed': empty.value, 'reached-top': y.value >= navHeight.value, 'is-blog': page.value.isBlogPost, + 'with-outline': !props.showOutline, } }) @@ -64,7 +66,7 @@ const showLocalNav = computed(() => { {{ themeData.sidebarMenuLabel || 'Menu' }} - + @@ -113,6 +115,10 @@ const showLocalNav = computed(() => { .local-nav .menu { visibility: hidden; } + + .local-nav.with-outline { + display: none; + } } @media (min-width: 1280px) { @@ -149,7 +155,7 @@ const showLocalNav = computed(() => { @media (min-width: 768px) { .menu { - padding: 0 32px; + padding: 12px 32px 11px; } }