Browse Source

fix(GlobalFooter): manually define link item keys (#586)

pull/574/merge
Connor Brathwaite 8 years ago
committed by 偏右
parent
commit
474c74680d
  1. 8
      src/components/GlobalFooter/demo/basic.md
  2. 2
      src/components/GlobalFooter/index.js
  3. 5
      src/layouts/BasicLayout.js
  4. 2
      src/layouts/UserLayout.js

8
src/components/GlobalFooter/demo/basic.md

@ -11,12 +11,16 @@ import GlobalFooter from 'ant-design-pro/lib/GlobalFooter';
import { Icon } from 'antd';
const links = [{
key: '帮助',
title: '帮助',
href: '',
}, {
title: '隐私',
href: '',
key: 'github'
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
}, {
key: '条款',
title: '条款',
href: '',
blankTarget: true,

2
src/components/GlobalFooter/index.js

@ -11,7 +11,7 @@ export default ({ className, links, copyright }) => {
<div className={styles.links}>
{links.map(link => (
<a
key={link.title}
key={link.key}
target={link.blankTarget ? '_blank' : '_self'}
href={link.href}
>

5
src/layouts/BasicLayout.js

@ -184,14 +184,17 @@ class BasicLayout extends React.PureComponent {
</div>
<GlobalFooter
links={[{
key: 'Pro 首页',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
}, {
title: 'GitHub',
key: 'github',
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
}, {
key: 'Ant Design',
title: 'Ant Design',
href: 'http://ant.design',
blankTarget: true,

2
src/layouts/UserLayout.js

@ -11,9 +11,11 @@ const links = [{
title: '帮助',
href: '',
}, {
key: '隐私',
title: '隐私',
href: '',
}, {
key: '隐私',
title: '条款',
href: '',
}];

Loading…
Cancel
Save