From d6a56da3db9d3e17d92bc41fdb4ae1009c861654 Mon Sep 17 00:00:00 2001 From: Jeepeng Date: Tue, 23 Jan 2018 18:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=A2=E5=8C=85=E5=B1=91?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=EF=BC=88=E5=A6=82`/issues/new`=20=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB=E8=AE=A4=E4=B8=BA`/issues/:id`=EF=BC=89=20(#801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PageHeader/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/PageHeader/index.js b/src/components/PageHeader/index.js index ed86137d..8efba9ca 100644 --- a/src/components/PageHeader/index.js +++ b/src/components/PageHeader/index.js @@ -9,13 +9,15 @@ import styles from './index.less'; const { TabPane } = Tabs; function getBreadcrumb(breadcrumbNameMap, url) { - let breadcrumb = {}; - Object.keys(breadcrumbNameMap).forEach((item) => { - if (pathToRegexp(item).test(url)) { - breadcrumb = breadcrumbNameMap[item]; - } - }); - return breadcrumb; + let breadcrumb = breadcrumbNameMap[url]; + if (!breadcrumb) { + Object.keys(breadcrumbNameMap).forEach((item) => { + if (pathToRegexp(item).test(url)) { + breadcrumb = breadcrumbNameMap[item]; + } + }); + } + return breadcrumb || {}; } export default class PageHeader extends PureComponent { -- GitLab