You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

374 B

order title
3 固定状态改变的回调

可以获得是否固定的状态。

import { Affix, Button } from 'antd';


const onChange = function (affixed) {
  console.log(affixed); // true or false
};

ReactDOM.render(
  <Affix offsetTop={120} onChange={onChange}>
    <Button>固定在距离顶部 120px 的位置</Button>
  </Affix>
, mountNode);