改成出现一般才切换

This commit is contained in:
liaoxuezhi 2019-11-13 19:06:18 +08:00
parent 050e6d2589
commit a90bda13e6
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@ export interface PanelProps extends RendererProps {
footerClassName?: string;
actionsClassName?: string;
bodyClassName?: string;
children?: React.ReactNode | ((props: any) => JSX.Element);
affixFooter?: boolean | 'always';
}
@ -80,7 +79,7 @@ export default class Panel extends React.Component<PanelProps> {
} else {
const clip = footerDom.getBoundingClientRect();
const clientHeight = window.innerHeight;
affixed = clip.top > clientHeight;
affixed = clip.top + clip.height / 2 > clientHeight;
}
affixed ? affixDom.classList.add('in') : affixDom.classList.remove('in');