瀏覽代碼

修改兼容性问题

1
mo 2 年之前
父節點
當前提交
b70a924ebe
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 2 0
      src/layout/components/AppMain.vue
  2. 6 1
      src/utils/draggable.js

+ 2 - 0
src/layout/components/AppMain.vue

@@ -557,6 +557,7 @@ export default {
     right: 0;
   top: 250px;
     position: absolute;
+    z-index: 5000;
   }
 }
 
@@ -568,6 +569,7 @@ export default {
   /*50 = navbar  */
   /* height: calc(100vh - 80px); */
   /* height: 100vh; */
+  user-select:none;
   padding-top: 90px;
   /* min-width: 1440px; */
   position: relative;

+ 6 - 1
src/utils/draggable.js

@@ -27,8 +27,13 @@ const draggable = {
         } else if (y > maxY) {
           y = maxY
         }
-
+        let wrap =  document.getElementsByClassName('app-main draggable-box')[0]
+        if(x>wrap.offsetWidth-35){
+          x = wrap.offsetWidth-35
+        }
         el.style.left = x + 'px'
+
+        console.log(x,'新坐标',el)
         el.style.top = y + 'px'
         lastTime = new Date().getTime();
         if( (lastTime - firstTime) < 200){