fix: NavLink全部加end属性,修复父路径永远选中问题
This commit is contained in:
@@ -12,7 +12,7 @@ export function BottomTab() {
|
|||||||
<NavLink
|
<NavLink
|
||||||
key={item.path}
|
key={item.path}
|
||||||
to={item.path}
|
to={item.path}
|
||||||
end={item.path === '/'}
|
end
|
||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
cn(
|
cn(
|
||||||
'flex flex-1 flex-col items-center gap-0.5 py-1 text-xs transition-colors',
|
'flex flex-1 flex-col items-center gap-0.5 py-1 text-xs transition-colors',
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export function Sidebar() {
|
|||||||
<NavLink
|
<NavLink
|
||||||
key={item.path}
|
key={item.path}
|
||||||
to={item.path}
|
to={item.path}
|
||||||
end={item.path === '/'}
|
end
|
||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
cn(
|
cn(
|
||||||
'flex items-center gap-3 px-5 py-2 text-sm transition-colors',
|
'flex items-center gap-3 px-5 py-2 text-sm transition-colors',
|
||||||
|
|||||||
Reference in New Issue
Block a user