diff --git a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/drag.ts b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/drag.ts index 89f25ba..f3be967 100644 --- a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/drag.ts +++ b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/drag.ts @@ -55,17 +55,19 @@ const itemDrag = ( onmove(e); }; - if ("ontouchmove" in document.documentElement === true) { - document.ontouchmove = (e: TouchEvent) => { - if (e.changedTouches && e.changedTouches.length) { - onmove({ - movementX: 1, - movementY: 1, - clientX: e.changedTouches[0].clientX, - clientY: e.changedTouches[0].clientY, - }); - } - }; + if ((window).touchPriority) { + if ("ontouchmove" in document.documentElement === true) { + document.ontouchmove = (e: TouchEvent) => { + if (e.changedTouches && e.changedTouches.length) { + onmove({ + movementX: 1, + movementY: 1, + clientX: e.changedTouches[0].clientX, + clientY: e.changedTouches[0].clientY, + }); + } + }; + } } const onmoveend = (e: any) => { @@ -94,8 +96,10 @@ const itemDrag = ( }; document.onmouseup = onmoveend; - if ("ontouchend" in document.documentElement === true) { - document.ontouchend = (e) => onmoveend(e); + if ((window).touchPriority) { + if ("ontouchend" in document.documentElement === true) { + document.ontouchend = (e) => onmoveend(e); + } } }; export default itemDrag; diff --git a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/renderData.ts b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/renderData.ts index d506ffc..d71a254 100644 --- a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/renderData.ts +++ b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/renderData.ts @@ -30,78 +30,84 @@ function render(props: any) { transform: `rotate(${style.rotate}deg)`, }; }); + + // pad 放大拖拽的点 + let targetResizeIconSize = props.resizeIconSize; + if ((window).isPad) { + targetResizeIconSize *= 1.5; + } const dragElResizeIcon = computed(() => { return [ { class: "drag-lt", style: { - top: -(props.resizeIconSize / 2) + "px", - left: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + top: -(targetResizeIconSize / 2) + "px", + left: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-ct", style: { - top: -(props.resizeIconSize / 2) + "px", - left: style.width / 2 - props.resizeIconSize / 2 + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + top: -(targetResizeIconSize / 2) + "px", + left: style.width / 2 - targetResizeIconSize / 2 + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-rt", style: { - top: -(props.resizeIconSize / 2) + "px", - right: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + top: -(targetResizeIconSize / 2) + "px", + right: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-rc", style: { - top: style.height / 2 - props.resizeIconSize / 2 + "px", - right: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + top: style.height / 2 - targetResizeIconSize / 2 + "px", + right: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-rb", style: { - bottom: -(props.resizeIconSize / 2) + "px", - right: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + bottom: -(targetResizeIconSize / 2) + "px", + right: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-bc", style: { - bottom: -(props.resizeIconSize / 2) + "px", - left: style.width / 2 - props.resizeIconSize / 2 + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + bottom: -(targetResizeIconSize / 2) + "px", + left: style.width / 2 - targetResizeIconSize / 2 + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-lb", style: { - bottom: -(props.resizeIconSize / 2) + "px", - left: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + bottom: -(targetResizeIconSize / 2) + "px", + left: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, { class: "drag-lc", style: { - top: style.height / 2 - props.resizeIconSize / 2 + "px", - left: -(props.resizeIconSize / 2) + "px", - width: props.resizeIconSize + "px", - height: props.resizeIconSize + "px", + top: style.height / 2 - targetResizeIconSize / 2 + "px", + left: -(targetResizeIconSize / 2) + "px", + width: targetResizeIconSize + "px", + height: targetResizeIconSize + "px", }, }, ]; diff --git a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/resize.ts b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/resize.ts index 3c62b0c..876ad46 100644 --- a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/resize.ts +++ b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/func/resize.ts @@ -100,17 +100,19 @@ const itemResize = ( }; document.onmousemove = onmove; - if ("ontouchmove" in document.documentElement === true) { - document.ontouchmove = (e: TouchEvent) => { - if (e.changedTouches && e.changedTouches.length) { - onmove({ - movementX: 1, - movementY: 1, - clientX: e.changedTouches[0].clientX, - clientY: e.changedTouches[0].clientY, - }); - } - }; + if ((window).touchPriority) { + if ("ontouchmove" in document.documentElement === true) { + document.ontouchmove = (e: TouchEvent) => { + if (e.changedTouches && e.changedTouches.length) { + onmove({ + movementX: 1, + movementY: 1, + clientX: e.changedTouches[0].clientX, + clientY: e.changedTouches[0].clientY, + }); + } + }; + } } const onmoveend = (e: any) => { @@ -139,8 +141,10 @@ const itemResize = ( }; document.onmouseup = onmoveend; - if ("ontouchend" in document.documentElement === true) { - document.ontouchend = (e) => onmoveend(e); + if ((window).touchPriority) { + if ("ontouchend" in document.documentElement === true) { + document.ontouchend = (e) => onmoveend(e); + } } }; export default itemResize; diff --git a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue index 1f1f2f1..0837aad 100644 --- a/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue +++ b/src/third_lib/vue3-resize-drag/components/vue3-resize-drag/index.vue @@ -31,7 +31,6 @@