mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
29 lines
668 B
TypeScript
29 lines
668 B
TypeScript
|
import React from 'react';
|
||
|
import { Anchor } from 'antd';
|
||
|
|
||
|
const { Link } = Anchor;
|
||
|
|
||
|
const handleClick = (
|
||
|
e: React.MouseEvent<HTMLElement>,
|
||
|
link: {
|
||
|
title: React.ReactNode;
|
||
|
href: string;
|
||
|
},
|
||
|
) => {
|
||
|
e.preventDefault();
|
||
|
console.log(link);
|
||
|
};
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Anchor affix={false} onClick={handleClick}>
|
||
|
<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>
|
||
|
);
|
||
|
|
||
|
export default App;
|