Commit 0148ddb3 authored by afc163's avatar afc163

Add document links

parent 9867f6e6
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() {
......
......@@ -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 (
<SubMenu
......@@ -96,7 +101,7 @@ class BasicLayout extends React.PureComponent {
}
return (
<Menu.Item key={item.key || item.path}>
<Link to={itemPath}>
<Link to={itemPath} target={item.target}>
{item.icon && <Icon type={item.icon} />}
<span>{item.name}</span>
</Link>
......@@ -295,17 +300,21 @@ class BasicLayout extends React.PureComponent {
</Switch>
<GlobalFooter
links={[{
title: '帮助',
href: '',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
}, {
title: '隐私',
href: '',
title: '文档',
href: 'http://pro.ant.design/docs/getting-started',
}, {
title: '条款',
href: '',
blankTarget: true,
title: 'GitHub',
href: 'https://github.com/ant-design/ant-design-pro',
}]}
copyright={<div>Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品</div>}
copyright={
<div>
Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品
</div>
}
/>
</Content>
</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