mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 11:39:28 +08:00
d44f404eae
* chore: improve sort api table scripts * sort api * add ignore * Revert "sort api" This reverts commit 343505d5f09d69349ce1fbdaea2a9faa7e852207. * sort api * Update package.json * sort api * Delete sort-api.js * sort api * sort api * sort api * fix * Update index.zh-CN.md * fix input-number * fix input-number * sort func * fix * Method moved to the end * carousel method
39 lines
1.3 KiB
Markdown
39 lines
1.3 KiB
Markdown
---
|
|
category: Components
|
|
subtitle: 锚点
|
|
cols: 2
|
|
type: 其他
|
|
title: Anchor
|
|
cover: https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg
|
|
---
|
|
|
|
用于跳转到页面指定位置。
|
|
|
|
## 何时使用
|
|
|
|
需要展现当前页面上可供跳转的锚点链接,以及快速在锚点之间跳转。
|
|
|
|
## API
|
|
|
|
### Anchor Props
|
|
|
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
|
| --- | --- | --- | --- | --- |
|
|
| affix | 固定模式 | boolean | true | |
|
|
| bounds | 锚点区域边界 | number | 5 | |
|
|
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window | |
|
|
| getCurrentAnchor | 自定义高亮的锚点 | () => string | - | |
|
|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
|
|
| showInkInFixed | `affix={false}` 时是否显示小圆点 | boolean | false | |
|
|
| targetOffset | 锚点滚动偏移量,默认与 offsetTop 相同,[例子](#components-anchor-demo-targetOffset) | number | - | |
|
|
| onChange | 监听锚点链接改变 | (currentActiveLink: string) => void | - | |
|
|
| onClick | `click` 事件的 handler | function(e: Event, link: Object) | - | |
|
|
|
|
### Link Props
|
|
|
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
|
| --- | --- | --- | --- | --- |
|
|
| href | 锚点链接 | string | - | |
|
|
| target | 该属性指定在何处显示链接的资源。 | string | - | |
|
|
| title | 文字内容 | ReactNode | - | |
|