diff --git a/src/components/subnav/main.js b/src/components/subnav/main.js index af3b0784..26d64a48 100644 --- a/src/components/subnav/main.js +++ b/src/components/subnav/main.js @@ -21,7 +21,7 @@ export default class topNav extends React.Component{ showlinkmenu(e,item){ let self=this; try{ - item.child.forEach(item=>{ + item.children.forEach(item=>{ if(item.level ===5){ sessionStorage.setItem('pathname2',item.router); throw '终止循环' @@ -30,11 +30,11 @@ export default class topNav extends React.Component{ }catch(e){ } self.setState({'linkshowname':item.title}); - self.setState({'menulinklist':item.child}); + self.setState({'menulinklist':item.children}); // 防止刷新页面,导航签清空 - sessionStorage.setItem('menulinklist',JSON.stringify(item.child)); + sessionStorage.setItem('menulinklist',JSON.stringify(item.children)); sessionStorage.setItem('showflag',true); sessionStorage.setItem('linkshowname',item.title); } @@ -80,7 +80,7 @@ export default class topNav extends React.Component{ { this.state.navlists.map((item,i)=>{ return ( - item.child&&item.child.length>0?this.showlinkmenu(e,item)} >{item.title}:null + item.children&&item.children.length>0?this.showlinkmenu(e,item)} >{item.title}:null ) }) @@ -95,7 +95,7 @@ export default class topNav extends React.Component{