@cainiaofe/cn-ui-m
Version:
32 lines (31 loc) • 858 B
TypeScript
import * as React from 'react';
import type { ScrollContainer } from "../../../types";
export interface CnAffixProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* 指定滚动的容器。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
* @default body
*/
container?: ScrollContainer;
/**
* 是否禁用
* @default false
*/
disabled?: boolean;
/**
* 吸顶时与顶部的距离,单位`px`
* @default 0
*/
offsetTop?: string | number;
/**
* 吸顶时的 z-index
* @default 99
*/
zIndex?: number;
/**
* 滚动时触发,scrollTop: 距离顶部位置,isFixed: 是否吸顶
*/
onAffix?: (context: {
scrollTop: number;
isFixed: boolean;
}) => void;
}