Skip to content

Commit

Permalink
fix(GuDragResizePlus): fix emit update many times
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaius-98 committed Jul 26, 2024
1 parent 0425fd8 commit e6552aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gaius-utils",
"private": false,
"version": "1.1.7",
"version": "1.1.8",
"author": {
"name": "WangGuoshuai",
"email": "2388838628@qq.com"
Expand Down
14 changes: 8 additions & 6 deletions packages/components/GuDragResizePlus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,14 @@ const onBeforeTransfrom = (data: DragResizeNodeInfo) => {
watch(
() => [left.value, width.value, height.value, top.value],
() => {
onTransformNode({
width: width.value,
height: height.value,
left: left.value,
top: top.value,
});
if (guDragResizePlusRef.value) {
const lastTransform = guDragResizePlusRef.value.style.transform;
guDragResizePlusRef.value.style.width = `${width.value}px`;
guDragResizePlusRef.value.style.height = `${height.value}px`;
guDragResizePlusRef.value.style.transform = `${removeTransform(
lastTransform
)} translate3d(${left.value}px, ${top.value}px,0)`;
}
}
);
onMounted(() => {
Expand Down

0 comments on commit e6552aa

Please sign in to comment.