(add) navにfixedを追加

This commit is contained in:
kakkokari-gtyih 2024-01-21 11:51:14 +09:00
parent 91e87a99fc
commit 5f5848a5c9

View File

@ -1,7 +1,8 @@
<template> <template>
<div <div
:class="[ :class="[
'sticky top-0 z-[9900] transition', 'top-0 z-[9900] w-full transition',
fixed ? 'fixed' : 'sticky',
{ {
'shadow bg-opacity-90': (!disableShadow && scrollPos <= -40), 'shadow bg-opacity-90': (!disableShadow && scrollPos <= -40),
'bg-white dark:bg-gray-950': (disableShadow || scrollPos <= -40), 'bg-white dark:bg-gray-950': (disableShadow || scrollPos <= -40),
@ -101,11 +102,13 @@ const props = withDefaults(defineProps<{
slim?: boolean; slim?: boolean;
hasBorder?: boolean; hasBorder?: boolean;
landing?: boolean; landing?: boolean;
fixed?: boolean;
}>(), { }>(), {
disableShadow: false, disableShadow: false,
slim: false, slim: false,
hasBorder: false, hasBorder: false,
landing: false, landing: false,
fixed: false,
}); });
const navOpen = ref(false); const navOpen = ref(false);