解决导航重复渲染bug
This commit is contained in:
parent
50c676d83e
commit
2c855f9f64
|
@ -41,8 +41,10 @@ export default class MouseMenu extends React.Component {
|
|||
}
|
||||
render() {
|
||||
let menuList = this.state.activeMenuList;//路由表
|
||||
const pathname = window.location.href.lastIndexOf('\/');
|
||||
const pathnamestr = window.location.href.substr(pathname);
|
||||
let urlHref=(window.location.href).replace(/^\/|\/$/g, '');
|
||||
const pathname = urlHref.lastIndexOf("/");
|
||||
const pathnamestr = urlHref.substr(pathname);
|
||||
|
||||
return (
|
||||
<div className="mouseMenu" onMouseLeave={this.closeMenuMask.bind(this)} onMouseEnter={this.props.mouseEnter}>
|
||||
<div className="menuBody">
|
||||
|
|
|
@ -83,9 +83,9 @@ export default class topNav extends React.Component {
|
|||
let history0 = window.history.length <= 1;
|
||||
let routeflag = sessionStorage.getItem("showflag");
|
||||
let breaknav = JSON.parse(sessionStorage.getItem("breaknav"));
|
||||
let pathnameBreak = sessionStorage.getItem("pathname2");
|
||||
const pathname = window.location.href.lastIndexOf("/");
|
||||
const pathnamestr = window.location.href.substr(pathname);
|
||||
let urlHref=(window.location.href).replace(/^\/|\/$/g, '');
|
||||
const pathname = urlHref.lastIndexOf("/");
|
||||
const pathnamestr = urlHref.substr(pathname);
|
||||
let breakflag =
|
||||
pathnamestr.includes("add") ||
|
||||
pathnamestr.includes("aid") ||
|
||||
|
|
Loading…
Reference in New Issue