diff --git a/src/common/nav.js b/src/common/nav.js index 42153e2b40f37fdfb3c8e929710958c4911f1d41..4eb70cf56f956d29d5708b77081b48b9431db162 100644 --- a/src/common/nav.js +++ b/src/common/nav.js @@ -1,5 +1,6 @@ import BasicLayout from '../layouts/BasicLayout'; import UserLayout from '../layouts/UserLayout'; +import BlankLayout from '../layouts/BlankLayout'; import Analysis from '../routes/Dashboard/Analysis'; import Monitor from '../routes/Dashboard/Monitor'; @@ -172,6 +173,15 @@ const data = [{ component: RegisterResult, }], }], +}, { + component: BlankLayout, + layout: 'BlankLayout', + children: { + name: '使用文档', + path: 'http://pro.ant.design/docs/getting-started', + target: '_blank', + icon: 'book', + }, }]; export function getNavData() { diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index eb2b11a691139b3f32a42f454206ab5600debbe3..4da41ac0d88e7859ab2cf743e350e5f1601e8d40 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -76,7 +76,12 @@ class BasicLayout extends React.PureComponent { if (!item.name) { return null; } - const itemPath = `${parentPath}/${item.path || ''}`.replace(/\/+/g, '/'); + let itemPath; + if (item.path.indexOf('http') === 0) { + itemPath = item.path; + } else { + itemPath = `${parentPath}/${item.path || ''}`.replace(/\/+/g, '/'); + } if (item.children && item.children.some(child => child.name)) { return ( - + {item.icon && } {item.name} @@ -295,17 +300,21 @@ class BasicLayout extends React.PureComponent { Copyright 2017 蚂蚁金服体验技术部出品} + copyright={ +
+ Copyright 2017 蚂蚁金服体验技术部出品 +
+ } />