From 0148ddb32676ce8f23579bafb8b83f48aa0f43cf Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 25 Oct 2017 16:08:37 +0800 Subject: [PATCH] Add document links --- src/common/nav.js | 10 ++++++++++ src/layouts/BasicLayout.js | 29 +++++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/common/nav.js b/src/common/nav.js index 42153e2b..4eb70cf5 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 eb2b11a6..4da41ac0 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 蚂蚁金服体验技术部出品 +
+ } /> -- GitLab