File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const navLinks = [
2121 <ul class =" menu menu-horizontal px-1" >
2222 { navLinks .map ((link ) => (
2323 <li >
24- <a href = { link .href } class :list = { [{ ' active ' : currentPath .startsWith (link .href ) } ]} >
24+ <a href = { link .href } class :list = { [currentPath === link . href || currentPath === ` ${ link . href }/ ` || currentPath .startsWith (link .href + ' / ' ) ? ' menu-active ' : null ]} >
2525 { link .label }
2626 </a >
2727 </li >
@@ -53,7 +53,7 @@ const navLinks = [
5353 <ul tabindex =" 0" class =" menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52" >
5454 { navLinks .map ((link ) => (
5555 <li >
56- <a href = { link .href } class :list = { [{ ' active ' : currentPath .startsWith (link .href ) } ]} >
56+ <a href = { link .href } class :list = { [currentPath === link . href || currentPath === ` ${ link . href }/ ` || currentPath .startsWith (link .href + ' / ' ) ? ' menu-active ' : null ]} >
5757 { link .label }
5858 </a >
5959 </li >
You can’t perform that action at this time.
0 commit comments