From 2d2a4be3a2c276d90cd8eb290cd5786dfaa62fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 28 Sep 2023 16:23:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E3=80=81=E8=B4=A6=E5=8F=B7=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E3=80=81=E8=B4=A6=E5=8F=B7=E5=A4=87=E4=BB=BD=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=89=A7=E8=A1=8C=E6=AC=A1=E6=95=B0=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=88=97=E8=A1=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/TabPage/index.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/layout/components/TabPage/index.vue b/src/layout/components/TabPage/index.vue index 4260b3325..32c1c1726 100644 --- a/src/layout/components/TabPage/index.vue +++ b/src/layout/components/TabPage/index.vue @@ -28,7 +28,7 @@ - + @@ -60,6 +60,11 @@ export default { required: true } }, + data() { + return { + loading: true + } + }, computed: { iActiveMenu: { get() { @@ -90,6 +95,18 @@ export default { return needActiveComponent } }, + watch: { + $route(to, from) { + const activeTab = to.query?.activeTab + if (activeTab && this.iActiveMenu !== activeTab) { + this.iActiveMenu = activeTab + this.loading = false + setTimeout(() => { + this.loading = true + }) + } + } + }, created() { this.iActiveMenu = this.getPropActiveTab() },