From e661ae08132604f01176ee13f5113512a86e6250 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Sun, 29 Nov 2020 20:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E7=AD=BE=E6=A0=87=E9=A2=98=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E7=9A=84bug=EF=BC=9B:bug:=20fix:=20the=20problem=20that=20sett?= =?UTF-8?q?ing=20tabs=20title=20not=20affect;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/tabs-page-plugin.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/tabs-page-plugin.js b/src/plugins/tabs-page-plugin.js index 6c9d95c..4075a55 100644 --- a/src/plugins/tabs-page-plugin.js +++ b/src/plugins/tabs-page-plugin.js @@ -7,8 +7,8 @@ const TabsPagePlugin = { window.dispatchEvent(event) }, $refreshPage(route) { - const fullPath = typeof route === 'object' ? route.fullPath : route - const event = new CustomEvent('page:refresh', {detail:{fullPath}}) + const path = typeof route === 'object' ? route.path : route + const event = new CustomEvent('page:refresh', {detail:{pageKey: path}}) window.dispatchEvent(event) }, $openPage(route, title) { @@ -17,16 +17,16 @@ const TabsPagePlugin = { }, $setPageTitle(route, title) { if (title) { - const fullPath = typeof route === 'object' ? route.fullPath : route - this.$store.commit('setting/setCustomTitle', {path: fullPath, title}) + const path = typeof route === 'object' ? route.path : route + this.$store.commit('setting/setCustomTitle', {path, title}) } } }, computed: { customTitle() { const customTitles = this.$store.state.setting.customTitles - const fullPath = this.$route.fullPath - const custom = customTitles.find(item => item.path === fullPath) + const path = this.$route.path + const custom = customTitles.find(item => item.path === path) return custom && custom.title } }