Skip to content

Commit

Permalink
fix: 🐛链式移动时日期问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyjone committed May 13, 2023
1 parent fce07ce commit 128ca9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/composables/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
4 changes: 2 additions & 2 deletions src/models/data/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 一条数据类
*/

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 128ca9f

Please sign in to comment.