From bd6e743ee31ed425ca75316c57ac591d468a69c3 Mon Sep 17 00:00:00 2001 From: From-wh Date: Tue, 25 Apr 2023 12:24:29 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E4=BC=98=E5=8C=96=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/navBars/tagsView/tagsView.vue | 18 ++++++++++++------ .../src/pages/setting/notification/index.vue | 4 ++-- .../src/pages/setting/systemMenus/index.vue | 14 ++------------ 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/template/admin/src/layout/navBars/tagsView/tagsView.vue b/template/admin/src/layout/navBars/tagsView/tagsView.vue index 860469f3b..67912c8e7 100644 --- a/template/admin/src/layout/navBars/tagsView/tagsView.vue +++ b/template/admin/src/layout/navBars/tagsView/tagsView.vue @@ -99,18 +99,14 @@ export default { if (!this.$store.state.app.tagNavList.length) { this.getTagsViewRoutes(); } - // this.$nextTick((e) => { - // console.log(this.$refs.tagsView.offsetWidth); - // console.log(this.$refs.tagsUlRef.offsetWidth); - // }); if (this.$refs.tagsView.offsetWidth < this.$refs.scrollbarRef.$refs.wrap.scrollWidth) { this.scrollTagIcon = true; } window.addEventListener('resize', () => { - console.log(this.$refs.tagsView.offsetWidth); - console.log(this.$refs.scrollbarRef.$refs.wrap.scrollWidth); if (this.$refs.tagsView.offsetWidth < this.$refs.scrollbarRef.$refs.wrap.scrollWidth) { this.scrollTagIcon = true; + } else { + this.scrollTagIcon = false; } }); }, @@ -305,6 +301,15 @@ export default { break; } }, + refreshIcon() { + this.$nextTick((e) => { + if (this.$refs.tagsView.offsetWidth < this.$refs.scrollbarRef.$refs.wrap.scrollWidth) { + this.scrollTagIcon = true; + } else { + this.scrollTagIcon = false; + } + }); + }, // 1、刷新当前 tagsView: refreshCurrentTagsView(path) { this.bus.$emit('onTagsViewRefreshRouterView', path); @@ -361,6 +366,7 @@ export default { this.addTagsView(to.path, to); this.getTagsRefsIndex(to.path); this.tagsViewmoveToCurrentTag(); + this.refreshIcon(); }, deep: true, }, diff --git a/template/admin/src/pages/setting/notification/index.vue b/template/admin/src/pages/setting/notification/index.vue index a807207f4..fa1d1cb8f 100644 --- a/template/admin/src/pages/setting/notification/index.vue +++ b/template/admin/src/pages/setting/notification/index.vue @@ -7,7 +7,7 @@ - +