Browse Source

Add document links

pull/26/head
afc163 9 years ago
parent
commit
0148ddb326
  1. 10
      src/common/nav.js
  2. 29
      src/layouts/BasicLayout.js

10
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() {

29
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 (
<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>

Loading…
Cancel
Save