1 | /// <reference types="react" />
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 |
|
6 | export interface AffixProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
7 | /**
|
8 | * 设置 Affix 需要监听滚动事件的容器元素
|
9 | */
|
10 | container?: () => React.ReactElement<any>;
|
11 |
|
12 | /**
|
13 | * 距离窗口顶部达到指定偏移量后触发
|
14 | */
|
15 | offsetTop?: number;
|
16 |
|
17 | /**
|
18 | * 距离窗口底部达到制定偏移量后触发
|
19 | */
|
20 | offsetBottom?: number;
|
21 |
|
22 | /**
|
23 | * 当元素的样式发生固钉样式变化时触发的回调函数
|
24 | */
|
25 | onAffix?: (affixed: boolean) => void;
|
26 |
|
27 | /**
|
28 | * 是否启用绝对布局实现 affix
|
29 | */
|
30 | useAbsolute?: boolean;
|
31 | }
|
32 |
|
33 | export default class Affix extends React.Component<AffixProps, any> {}
|