forked from ant-design/ant-design
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Anchor): add onChange prop (ant-design#18715)
* feat(Anchor): add onChange prop * test(Anchor): add onChange prop * update snapshots
- Loading branch information
1 parent
0aa0ce0
commit d017cc5
Showing
7 changed files
with
145 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
order: 6 | ||
title: | ||
zh-CN: 监听锚点链接改变 | ||
en-US: Listening for anchor link change | ||
--- | ||
|
||
## zh-CN | ||
|
||
监听锚点链接改变 | ||
|
||
## en-US | ||
|
||
Listening for anchor link change. | ||
|
||
```jsx | ||
import { Anchor } from 'antd'; | ||
|
||
const { Link } = Anchor; | ||
|
||
const onChange = link => { | ||
console.log('Anchor:OnChange', link); | ||
}; | ||
|
||
ReactDOM.render( | ||
<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>, | ||
mountNode, | ||
); | ||
``` |
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,5 +1,5 @@ | ||
--- | ||
order: 4 | ||
order: 5 | ||
title: | ||
zh-CN: 设置锚点滚动偏移量 | ||
en-US: Set Anchor scroll offset | ||
|
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