Selaa lähdekoodia

修改兼容性问题

1
mo 2 vuotta sitten
vanhempi
commit
b70a924ebe
2 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  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){