types(Tabs): use tsx (#8187)

This commit is contained in:
neverland
2021-02-20 17:49:34 +08:00
committed by GitHub
parent 9ad0eafae0
commit 906f01cc8e
15 changed files with 106 additions and 61 deletions

View File

@@ -1,6 +1,6 @@
import { isIOS as checkIsIOS } from '../validate/system';
type ScrollElement = Element | Window;
export type ScrollElement = Element | Window;
function isWindow(val: unknown): val is Window {
return val === window;
@@ -36,7 +36,7 @@ export function setRootScrollTop(value: number) {
}
// get distance from element top to page top or scroller top
export function getElementTop(el: ScrollElement, scroller?: HTMLElement) {
export function getElementTop(el: ScrollElement, scroller?: ScrollElement) {
if (isWindow(el)) {
return 0;
}