hanbaoshan
2020-08-04 1bc9dc3ac0f81047f7ecfe3f039c984d9776e84a
src/pages/desktop/index/components/DFrame.vue
@@ -145,8 +145,21 @@
        document.onmousemove = function (e) {
          e.preventDefault();
          window.getSelection().removeAllRanges();
          el.parentElement.style.left = e.clientX - disx + 'px';
          el.parentElement.style.top = e.clientY - disy + 'px';
          let toLeft = e.clientX - disx;
          let toTop = e.clientY - disy;
          //边界处理
          if(toLeft <= 0 ){
            toLeft = 0
          }else if(toLeft >= document.body.getBoundingClientRect().width-40){
            toLeft = document.body.getBoundingClientRect().width-40;
          }
          el.parentElement.style.left = toLeft + 'px';
          if(toTop <= 0 ){
            toTop = 0
          }else if(toTop >= document.body.getBoundingClientRect().height-40){
            toTop = document.body.getBoundingClientRect().height-40;
          }
          el.parentElement.style.top = toTop + 'px';
        };
        document.onmouseup = function () {
          el.dragLock = false;
@@ -185,7 +198,7 @@
<style scoped>
html,
body {
  heiht: 100%;
  height: 100%;
}
.d-frame {
  position: fixed;