Commit 52a786f4 by zhanghaozhe

nav icon

parent 416aad2b
import React from 'react'; import React from 'react';
import { NavLink, withRouter } from 'react-router-dom' import { NavLink, withRouter } from 'react-router-dom'
import './index.scss'; import './index.scss'
const navLinkConfig = [ const navLinkConfig = [
{ {
...@@ -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 ${location.pathname.startsWith(item.to) ? item.activeIcon : item.icon}`}/> <i className={`iconfont ${item.to.length > 1 ? location.pathname.startsWith(item.to) ? item.activeIcon : item.icon : location.pathname === item.to ? item.activeIcon : item.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