From 128ca9f821d2b6535bb8dd5f3007ff9b30f1159d Mon Sep 17 00:00:00 2001 From: jeremyjone Date: Sat, 13 May 2023 21:38:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=E9=93=BE=E5=BC=8F=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E6=97=A5=E6=9C=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useDrag.ts | 5 ++++- src/models/data/row.ts | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/composables/useDrag.ts b/src/composables/useDrag.ts index 52fd39e..ba0becf 100644 --- a/src/composables/useDrag.ts +++ b/src/composables/useDrag.ts @@ -37,7 +37,10 @@ export default () => { } const rect = (options?.target ?? el.value)?.getBoundingClientRect(); - delta.value = Math.abs(left.value - (rect?.left ?? 0)) + e.offsetX; + delta.value = + Math.abs(left.value - (rect?.left ?? 0)) + + e.offsetX + + (((e?.target as any)?.offsetLeft as number) ?? 0); options?.onStart?.(pos, e); }, diff --git a/src/models/data/row.ts b/src/models/data/row.ts index aeead8a..acef466 100644 --- a/src/models/data/row.ts +++ b/src/models/data/row.ts @@ -2,7 +2,7 @@ * @Author: JeremyJone * @Date: 2021-09-09 15:50:52 * @LastEditors: JeremyJone - * @LastEditTime: 2023-05-13 21:09:27 + * @LastEditTime: 2023-05-13 21:36:14 * @Description: 一条数据类 */ @@ -250,7 +250,7 @@ export default class RowItem { ) === 'l' ) this.__data[this.options.startLabel] = date.getOffset( - Variables.time.millisecondOf[unit] + -Variables.time.millisecondOf[unit] ).date; if (!linkage) return;