Commit 8276a0db by zhanghaozhe

nav icon

parent 1586ccb6
......@@ -38,7 +38,7 @@ const NavBar = React.memo(({location}) => {
<div className="nav-bar">
{
navLinkConfig.map(item => {
let {icon, text, ...rest} = item
let {icon, text, activeIcon, ...rest} = item
return (
<NavLink
activeClassName={'active'}
......@@ -46,7 +46,7 @@ const NavBar = React.memo(({location}) => {
key={icon}
{...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>
</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