From bef080c60abc30ae4e1cf5a131a9564b41d2bb63 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期日, 18 四月 2021 15:45:37 +0800 Subject: [PATCH] 升级mybatis到最新版3.5.6 阻止远程代码执行漏洞 --- ruoyi-ui/src/components/TopNav/index.vue | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index 2397628..3eebda4 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -47,7 +47,7 @@ topMenus() { let topMenus = []; this.routers.map((menu) => { - if (menu.hidden === false) { + if (menu.hidden !== true) { topMenus.push(menu); } }); @@ -95,21 +95,20 @@ return activePath; }, }, + beforeMount() { + window.addEventListener('resize', this.setVisibleNumber) + }, + beforeDestroy() { + window.removeEventListener('resize', this.setVisibleNumber) + }, mounted() { this.setVisibleNumber(); }, methods: { // 根据宽度计算设置显示栏数 setVisibleNumber() { - const width = document.body.getBoundingClientRect().width - 380; - const elWidth = this.$el.getBoundingClientRect().width; - const menuItemNodes = this.$el.children; - const menuWidth = Array.from(menuItemNodes).map( - (i) => i.getBoundingClientRect().width - ); - this.visibleNumber = ( - parseInt(width - elWidth) / parseInt(menuWidth) - ).toFixed(0); + const width = document.body.getBoundingClientRect().width / 3; + this.visibleNumber = parseInt(width / 85); }, // 菜单选择事件 handleSelect(key, keyPath) { -- Gitblit v1.9.2