From 9aeb7ac3a98ba0d568e1aef21a8a31294ac093c7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 14 Dec 2021 16:19:47 +0800
Subject: [PATCH] 弹窗中功能添加完善

---
 src/divForms/divForms.js |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/divForms/divForms.js b/src/divForms/divForms.js
index 2df0e84..72327a5 100644
--- a/src/divForms/divForms.js
+++ b/src/divForms/divForms.js
@@ -132,15 +132,17 @@
     }
 
     positionPopUp (windowCoord, id) {
-        const x = windowCoord.x
-        const y = windowCoord.y - document.getElementById(id).offsetHeight
-        // x = windowCoord.x - document.getElementById(id).offsetWidth
+        if (windowCoord != undefined && windowCoord.x && windowCoord.x != undefined && !Number.isNaN(windowCoord.x)) {
+            const x = windowCoord.x
+            const y = windowCoord.y - document.getElementById(id).offsetHeight
+            // x = windowCoord.x - document.getElementById(id).offsetWidth
 
-        document.getElementById(id).style.cssText = `
-        visibility:visible;
-        z-index:1;
-        transform:translate3d(${Math.round(x)}px,${Math.round(y)}px, 0);
-        `
+            document.getElementById(id).style.cssText = `
+            visibility:visible;
+            z-index:1;
+            transform:translate3d(${Math.round(x)}px,${Math.round(y)}px, 0);
+            `
+        }
     }
 }
 

--
Gitblit v1.9.3