Commit 0148ddb3 authored by afc163's avatar afc163

Add document links

parent 9867f6e6
import BasicLayout from '../layouts/BasicLayout'; import BasicLayout from '../layouts/BasicLayout';
import UserLayout from '../layouts/UserLayout'; import UserLayout from '../layouts/UserLayout';
import BlankLayout from '../layouts/BlankLayout';
import Analysis from '../routes/Dashboard/Analysis'; import Analysis from '../routes/Dashboard/Analysis';
import Monitor from '../routes/Dashboard/Monitor'; import Monitor from '../routes/Dashboard/Monitor';
...@@ -172,6 +173,15 @@ const data = [{ ...@@ -172,6 +173,15 @@ const data = [{
component: RegisterResult, component: RegisterResult,
}], }],
}], }],
}, {
component: BlankLayout,
layout: 'BlankLayout',
children: {
name: '使用文档',
path: 'http://pro.ant.design/docs/getting-started',
target: '_blank',
icon: 'book',
},
}]; }];
export function getNavData() { export function getNavData() {
......
...@@ -76,7 +76,12 @@ class BasicLayout extends React.PureComponent { ...@@ -76,7 +76,12 @@ class BasicLayout extends React.PureComponent {
if (!item.name) { if (!item.name) {
return null; 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)) { if (item.children && item.children.some(child => child.name)) {
return ( return (
<SubMenu <SubMenu
...@@ -96,7 +101,7 @@ class BasicLayout extends React.PureComponent { ...@@ -96,7 +101,7 @@ class BasicLayout extends React.PureComponent {
} }
return ( return (
<Menu.Item key={item.key || item.path}> <Menu.Item key={item.key || item.path}>
<Link to={itemPath}> <Link to={itemPath} target={item.target}>
{item.icon && <Icon type={item.icon} />} {item.icon && <Icon type={item.icon} />}
<span>{item.name}</span> <span>{item.name}</span>
</Link> </Link>
...@@ -295,17 +300,21 @@ class BasicLayout extends React.PureComponent { ...@@ -295,17 +300,21 @@ class BasicLayout extends React.PureComponent {
</Switch> </Switch>
<GlobalFooter <GlobalFooter
links={[{ links={[{
title: '帮助', title: 'Pro 首页',
href: '', href: 'http://pro.ant.design',
blankTarget: true,
}, { }, {
title: '隐私', title: '文档',
href: '', href: 'http://pro.ant.design/docs/getting-started',
}, { }, {
title: '条款', title: 'GitHub',
href: '', href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
}]} }]}
copyright={<div>Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品</div>} copyright={
<div>
Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品
</div>
}
/> />
</Content> </Content>
</Layout> </Layout>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment