From a4b0785f0fea8659da495dee378da14f7fe0c0cd Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Sun, 8 Nov 2020 12:20:40 +0800 Subject: [PATCH] =?UTF-8?q?bug:=20fix=20the=20problem=20that=20custom=20pa?= =?UTF-8?q?ge=20title=20not=20effect;=20=E4=BF=AE=E5=A4=8D=EF=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E4=B8=8D=E8=B5=B7=E4=BD=9C=E7=94=A8=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/PageLayout.vue | 4 ++++ src/layouts/tabs/TabsHead.vue | 2 +- src/layouts/tabs/TabsView.vue | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/layouts/PageLayout.vue b/src/layouts/PageLayout.vue index e936145..04c3aa8 100644 --- a/src/layouts/PageLayout.vue +++ b/src/layouts/PageLayout.vue @@ -95,6 +95,10 @@ export default { const path = route.path.length === 0 ? '/home' : route.path breadcrumb.push(this.$t(getI18nKey(path))) }) + let pageTitle = this.page && this.page.title + if (pageTitle) { + breadcrumb[breadcrumb.length - 1] = pageTitle + } return breadcrumb }, /** diff --git a/src/layouts/tabs/TabsHead.vue b/src/layouts/tabs/TabsHead.vue index 958662f..b958bfe 100644 --- a/src/layouts/tabs/TabsHead.vue +++ b/src/layouts/tabs/TabsHead.vue @@ -95,7 +95,7 @@ this.$emit('contextmenu', pageKey, e) }, pageName(page) { - return this.$t(getI18nKey(page.keyPath)) + return page.title || this.$t(getI18nKey(page.keyPath)) } } } diff --git a/src/layouts/tabs/TabsView.vue b/src/layouts/tabs/TabsView.vue index b8461bc..96a6978 100644 --- a/src/layouts/tabs/TabsView.vue +++ b/src/layouts/tabs/TabsView.vue @@ -249,6 +249,7 @@ export default { return { keyPath: route.matched[route.matched.length - 1].path, fullPath: route.fullPath, loading: false, + title: route.meta && route.meta.page && route.meta.page.title, unclose: route.meta && route.meta.page && (route.meta.page.closable === false), } },