From 09fbaa96c09e0cb7e429c6fb2958a46843485b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Tue, 8 Jan 2019 14:14:21 +0800 Subject: [PATCH] feat: add new config "title" (#3309) --- src/defaultSettings.js | 1 + src/layouts/BasicLayout.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/defaultSettings.js b/src/defaultSettings.js index c254c74e..0c611097 100644 --- a/src/defaultSettings.js +++ b/src/defaultSettings.js @@ -6,4 +6,5 @@ module.exports = { fixedHeader: false, // sticky header autoHideHeader: false, // auto hide header fixSiderbar: false, // sticky siderbar + title: 'Ant Design Pro', }; diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index dba40f34..d5306093 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -17,7 +17,7 @@ import Context from './MenuContext'; import Exception403 from '../pages/Exception/403'; import PageLoading from '@/components/PageLoading'; import SiderMenu from '@/components/SiderMenu'; - +import { title } from '../defaultSettings'; import styles from './BasicLayout.less'; // lazy load SettingDrawer @@ -116,14 +116,14 @@ class BasicLayout extends React.PureComponent { const currRouterData = this.matchParamsPath(pathname, breadcrumbNameMap); if (!currRouterData) { - return 'Ant Design Pro'; + return title; } const pageName = formatMessage({ id: currRouterData.locale || currRouterData.name, defaultMessage: currRouterData.name, }); - return `${pageName} - Ant Design Pro`; + return `${pageName} - ${title}`; }; getLayoutStyle = () => { -- GitLab