Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
193 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
import React from 'react'; | ||
import { Anchor } from 'antd'; | ||
|
||
const { Link } = Anchor; | ||
|
||
const getCurrentAnchor = () => '#components-anchor-demo-static'; | ||
|
||
const App: React.FC = () => ( | ||
<Anchor affix={false} getCurrentAnchor={getCurrentAnchor}> | ||
<Link href="#components-anchor-demo-basic" title="Basic demo" /> | ||
<Link href="#components-anchor-demo-static" title="Static demo" /> | ||
<Link href="#api" title="API"> | ||
<Link href="#anchor-props" title="Anchor Props" /> | ||
<Link href="#link-props" title="Link Props" /> | ||
</Link> | ||
</Anchor> | ||
<Anchor | ||
affix={false} | ||
getCurrentAnchor={getCurrentAnchor} | ||
items={[ | ||
{ | ||
key: '1', | ||
href: '#components-anchor-demo-basic', | ||
title: 'Basic demo', | ||
}, | ||
{ | ||
key: '2', | ||
href: '#components-anchor-demo-static', | ||
title: 'Static demo', | ||
}, | ||
{ | ||
key: '3', | ||
href: '#api', | ||
title: 'API', | ||
children: [ | ||
{ | ||
key: '4', | ||
href: '#anchor-props', | ||
title: 'Anchor Props', | ||
}, | ||
{ | ||
key: '5', | ||
href: '#link-props', | ||
title: 'Link Props', | ||
}, | ||
], | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,44 @@ | ||
import React from 'react'; | ||
import { Anchor } from 'antd'; | ||
|
||
const { Link } = Anchor; | ||
|
||
const onChange = (link: string) => { | ||
console.log('Anchor:OnChange', link); | ||
}; | ||
|
||
const App: React.FC = () => ( | ||
<Anchor affix={false} onChange={onChange}> | ||
<Link href="#components-anchor-demo-basic" title="Basic demo" /> | ||
<Link href="#components-anchor-demo-static" title="Static demo" /> | ||
<Link href="#api" title="API"> | ||
<Link href="#anchor-props" title="Anchor Props" /> | ||
<Link href="#link-props" title="Link Props" /> | ||
</Link> | ||
</Anchor> | ||
<Anchor | ||
affix={false} | ||
onChange={onChange} | ||
items={[ | ||
{ | ||
key: '1', | ||
href: '#components-anchor-demo-basic', | ||
title: 'Basic demo', | ||
}, | ||
{ | ||
key: '2', | ||
href: '#components-anchor-demo-static', | ||
title: 'Static demo', | ||
}, | ||
{ | ||
key: '3', | ||
href: '#api', | ||
title: 'API', | ||
children: [ | ||
{ | ||
key: '4', | ||
href: '#anchor-props', | ||
title: 'Anchor Props', | ||
}, | ||
{ | ||
key: '5', | ||
href: '#link-props', | ||
title: 'Link Props', | ||
}, | ||
], | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
import React from 'react'; | ||
import { Anchor } from 'antd'; | ||
|
||
const { Link } = Anchor; | ||
|
||
const App: React.FC = () => ( | ||
<Anchor affix={false}> | ||
<Link href="#components-anchor-demo-basic" title="Basic demo" /> | ||
<Link href="#components-anchor-demo-static" title="Static demo" /> | ||
<Link href="#api" title="API"> | ||
<Link href="#anchor-props" title="Anchor Props" /> | ||
<Link href="#link-props" title="Link Props" /> | ||
</Link> | ||
</Anchor> | ||
<Anchor | ||
affix={false} | ||
items={[ | ||
{ | ||
key: '1', | ||
href: '#components-anchor-demo-basic', | ||
title: 'Basic demo', | ||
}, | ||
{ | ||
key: '2', | ||
href: '#components-anchor-demo-static', | ||
title: 'Static demo', | ||
}, | ||
{ | ||
key: '3', | ||
href: '#api', | ||
title: 'API', | ||
children: [ | ||
{ | ||
key: '4', | ||
href: '#anchor-props', | ||
title: 'Anchor Props', | ||
}, | ||
{ | ||
key: '5', | ||
href: '#link-props', | ||
title: 'Link Props', | ||
}, | ||
], | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters