Commit 8276a0db by zhanghaozhe

nav icon

parent 1586ccb6
...@@ -38,7 +38,7 @@ const NavBar = React.memo(({location}) => { ...@@ -38,7 +38,7 @@ const NavBar = React.memo(({location}) => {
<div className="nav-bar"> <div className="nav-bar">
{ {
navLinkConfig.map(item => { navLinkConfig.map(item => {
let {icon, text, ...rest} = item let {icon, text, activeIcon, ...rest} = item
return ( return (
<NavLink <NavLink
activeClassName={'active'} activeClassName={'active'}
...@@ -46,7 +46,7 @@ const NavBar = React.memo(({location}) => { ...@@ -46,7 +46,7 @@ const NavBar = React.memo(({location}) => {
key={icon} key={icon}
{...rest} {...rest}
> >
<i className={`iconfont ${item.to.length > 1 ? location.pathname.startsWith(item.to) ? item.activeIcon : item.icon : location.pathname === item.to ? item.activeIcon : item.icon}`}/> <i className={`iconfont ${item.to.length > 1 ? location.pathname.startsWith(item.to) ? activeIcon : icon : location.pathname === item.to ? activeIcon : icon}`}/>
<span>{text}</span> <span>{text}</span>
</NavLink> </NavLink>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment