From efcc2e97beb8c3b05f422fe7efafa059447473de Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 01 八月 2024 17:23:58 +0800 Subject: [PATCH] 产品绑定工艺路线更新 --- src/utils/domUtils.ts | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/src/utils/domUtils.ts b/src/utils/domUtils.ts index 7efe9cb..3b3178f 100644 --- a/src/utils/domUtils.ts +++ b/src/utils/domUtils.ts @@ -2,11 +2,29 @@ import { upperFirst } from 'lodash-es'; export interface ViewportOffsetResult { + /** + * 鍏冪礌宸﹁竟璺濈 body 宸﹁竟鐨勮窛绂伙紙鍜� getBoundingClientRect 鐨� left 涓�鏍凤級 + */ left: number; + /** + * 鍏冪礌椤惰竟璺濈 body 椤惰竟鐨勮窛绂伙紙鍜� getBoundingClientRect 鐨� top 涓�鏍凤級 + */ top: number; + /** + * 鍏冪礌鍙宠竟璺濈 body 鍙宠竟鐨勮窛绂� + */ right: number; + /** + * 鍏冪礌搴曡竟璺濈 body 搴曡竟鐨勮窛绂� + */ bottom: number; + /** + * 鍐呭瀹藉害 + 璁$畻鍚庣殑 right + */ rightIncludeBody: number; + /** + * 鍐呭楂樺害 + 璁$畻鍚庣殑 bottom + */ bottomIncludeBody: number; } @@ -158,7 +176,7 @@ export function once(el: HTMLElement, event: string, fn: EventListener): void { const listener = function (this: any, ...args: unknown[]) { if (fn) { - fn.apply(this, args); + fn.apply(this, args as [evt: Event]); } off(el, event, listener); }; -- Gitblit v1.9.3