mirror of
https://github.com/youzan/vant.git
synced 2026-01-27 02:00:43 +08:00
types(Tabs): use tsx (#8187)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user