2016-10-28 14:02:55 +08:00
|
|
|
---
|
|
|
|
category: Components
|
2016-12-30 21:41:28 +08:00
|
|
|
type: Other
|
2016-11-18 17:02:57 +08:00
|
|
|
cols: 2
|
2016-10-28 14:02:55 +08:00
|
|
|
title: Anchor
|
|
|
|
---
|
|
|
|
|
2016-11-09 21:06:43 +08:00
|
|
|
Hyperlinks to scroll on one page.
|
2016-10-28 14:02:55 +08:00
|
|
|
|
|
|
|
## When To Use
|
|
|
|
|
2016-11-29 17:13:24 +08:00
|
|
|
For displaying anchor hyperlinks on page and jumping between them.
|
2016-10-28 14:02:55 +08:00
|
|
|
|
|
|
|
## API
|
|
|
|
|
2016-11-03 16:45:13 +08:00
|
|
|
### Anchor Props
|
|
|
|
|
2017-10-25 10:25:44 +08:00
|
|
|
| Property | Description | Type | Default |
|
|
|
|
| -------- | ----------- | ---- | ------- |
|
2018-01-09 08:38:29 +08:00
|
|
|
| affix | Fixed mode of Anchor | boolean | true |
|
2017-10-25 10:25:44 +08:00
|
|
|
| bounds | Bounding distance of anchor area | number | 5(px) |
|
2018-06-24 17:09:18 +08:00
|
|
|
| getContainer | Scrolling container | () => HTMLElement | () => window |
|
2017-10-25 10:25:44 +08:00
|
|
|
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
|
|
|
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
|
2017-02-21 14:44:20 +08:00
|
|
|
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false |
|
2018-08-28 20:20:46 +08:00
|
|
|
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - |
|
2016-11-03 16:45:13 +08:00
|
|
|
|
2016-11-07 11:04:36 +08:00
|
|
|
### Link Props
|
2016-10-28 14:02:55 +08:00
|
|
|
|
2017-10-25 10:25:44 +08:00
|
|
|
| Property | Description | Type | Default |
|
|
|
|
| -------- | ----------- | ---- | ------- |
|
|
|
|
| href | target of hyperlink | string | |
|
|
|
|
| title | content of hyperlink | string\|ReactNode | |
|