ant-design/components/affix/demo/on-change.md
2022-05-21 22:14:15 +08:00

28 lines
419 B
Markdown

---
order: 1
title:
zh-CN: 固定状态改变的回调
en-US: Callback
---
## zh-CN
可以获得是否固定的状态。
## en-US
Callback with affixed state.
```tsx
import { Affix, Button } from 'antd';
import React from 'react';
const App: React.FC = () => (
<Affix offsetTop={120} onChange={affixed => console.log(affixed)}>
<Button>120px to affix top</Button>
</Affix>
);
export default App;
```