From f2d38230699e29e8cbf62b76d12b990440128f54 Mon Sep 17 00:00:00 2001
From: chenghongxing <1126263215@qq.com>
Date: 星期日, 06 十二月 2020 11:31:31 +0800
Subject: [PATCH] 修复:当路由有查询参数时,设置页签标题不生效的问题;:bug: #166 fix: the problem that the setting of tab title is not effective when the route has query parameters;

---
 src/plugins/tabs-page-plugin.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/tabs-page-plugin.js b/src/plugins/tabs-page-plugin.js
index 4075a55..ddf382e 100644
--- a/src/plugins/tabs-page-plugin.js
+++ b/src/plugins/tabs-page-plugin.js
@@ -17,7 +17,8 @@
         },
         $setPageTitle(route, title) {
           if (title) {
-            const path = typeof route === 'object' ? route.path : route
+            let path = typeof route === 'object' ? route.path : route
+            path = path && path.split('?')[0]
             this.$store.commit('setting/setCustomTitle', {path, title})
           }
         }
@@ -25,7 +26,7 @@
       computed: {
         customTitle() {
           const customTitles = this.$store.state.setting.customTitles
-          const path = this.$route.path
+          const path = this.$route.path.split('?')[0]
           const custom = customTitles.find(item => item.path === path)
           return custom && custom.title
         }

--
Gitblit v1.9.1