From a583b23e03a59bdc5ddfe6998ad1df56e6e26a3c Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 18 Aug 2022 09:51:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/home.js | 13 +++---------- src/router/index.js | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/pages/home/home.js b/src/pages/home/home.js index 7a9e1294..bd42fad7 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -6,7 +6,7 @@ import Bus from '@/assets/eventBus.js' import Subnav from '@/components/subnav/main' import { Avatar, Pop, Sweetalert, Dialog, Icon, Notify } from 'zent' import ModifySelfpwd from './ModifySelfpwd' -import { router, navRoute } from '@/router/index' +import { router, navRoute, noShowSubMenu } from '@/router/index' import { getUserinfo, @@ -24,13 +24,6 @@ export default class App extends Component { setrender: 1, linkshow: '系统管理', isShowSub: true, - noShowSubMenu: [ - '/home/extension', - '/home/overview', - '/home/plan-create', - '/home/mytempMould', - '/home/edittemplate' - ], pathname: '', userInfo: {}, navlist: navRoute @@ -44,7 +37,7 @@ export default class App extends Component { Bus.addListener('closeMask', (prop) => { this.setState({ mouseMenuMask: prop }) }) - if (this.state.noShowSubMenu.indexOf(this.props.location.pathname) > -1) { + if (noShowSubMenu.indexOf(this.props.location.pathname) > -1) { this.setState({ isShowSub: false }) } else { this.setState({ isShowSub: true }) @@ -133,7 +126,7 @@ export default class App extends Component { } } - if (this.state.noShowSubMenu.indexOf(nextProps.location.pathname) > -1) { + if (noShowSubMenu.indexOf(nextProps.location.pathname) > -1) { this.setState({ isShowSub: false }) } else { this.setState({ isShowSub: true }) diff --git a/src/router/index.js b/src/router/index.js index afe1d64c..6730fa22 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -46,7 +46,7 @@ import DistriButorEdit from '@/pages/distributor/add/add' import MyTempMouldAdd from '@/pages/exchangepage/template/main.js' import MyExChangeTemplate from '@/pages/exchangepage/mytemplate/main.js' import CopyCode from '@/pages/exchangecode/copyCode/index' - +/* 基础路由 */ const router = [ { path: '/home/extension', @@ -250,6 +250,7 @@ const router = [ } ] +/* 导航现实路由 */ const navRoute = [ { name: '系统管理', @@ -326,4 +327,13 @@ const navRoute = [ } ] -export { router, navRoute } +/* 不显示路由 */ +const noShowSubMenu = [ + '/home/extension', + '/home/overview', + '/home/plan-create', + '/home/mytempMould', + '/home/edittemplate' +] + +export { router, navRoute, noShowSubMenu }