diff --git a/package/layer/src/composable/useMove.ts b/package/layer/src/composable/useMove.ts index 55927f82..dc4c9b4b 100644 --- a/package/layer/src/composable/useMove.ts +++ b/package/layer/src/composable/useMove.ts @@ -4,7 +4,8 @@ const useMove = function (el: HTMLElement, callback: Function) { let offsetY: number; if (el != null) { el.addEventListener("mousedown", function (event: any) { - if (event.path[0].className === "layui-layer-title") { + const path = event.path || (event.composedPath && event.composedPath()); + if (path[0].className === "layui-layer-title") { if (event.button == 0 && el != null) { const lexObj: any = getComputedStyle(el); offsetX = diff --git a/package/layer/src/composable/useResize.ts b/package/layer/src/composable/useResize.ts index 06885120..a4a91594 100644 --- a/package/layer/src/composable/useResize.ts +++ b/package/layer/src/composable/useResize.ts @@ -1,7 +1,8 @@ const useMove = function (el: HTMLElement, callback: Function) { if (el != null) { el.addEventListener("mousedown", function (event: any) { - if (event.path[0].className === "layui-layer-resize") { + const path = event.path || (event.composedPath && event.composedPath()); + if (path[0].className === "layui-layer-resize") { if (event.button == 0 && el != null) { var x = el.offsetLeft; var y = el.offsetTop;