From 990daf2d27072c2ecc755163485b276cb9ac15a9 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Mon, 5 Apr 2021 09:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E9=9D=A2=E5=8C=85=E5=B1=91=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B=20fix:=20the=20repeat=20problem=20o?= =?UTF-8?q?f=20breadcrumbs=20in=20PageLayout.vue;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/PageLayout.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layouts/PageLayout.vue b/src/layouts/PageLayout.vue index 3b6bb1a..6ce29a8 100644 --- a/src/layouts/PageLayout.vue +++ b/src/layouts/PageLayout.vue @@ -90,8 +90,10 @@ export default { ...mapMutations('setting', ['correctPageMinHeight']), getRouteBreadcrumb() { let routes = this.$route.matched + const path = this.$route.path let breadcrumb = [] - routes.forEach(route => { + routes.filter(item => path.includes(item.path)) + .forEach(route => { const path = route.path.length === 0 ? '/home' : route.path breadcrumb.push(this.$t(getI18nKey(path))) })