浏览代码

-修改破锁管理

jiangbiao 2 年之前
父节点
当前提交
1a07438056
共有 1 个文件被更改,包括 21 次插入2 次删除
  1. 21 2
      ui/src/views/apply/lock/lock-xx.vue

+ 21 - 2
ui/src/views/apply/lock/lock-xx.vue

@@ -1,12 +1,31 @@
 <template>
-<div class="app-container">
+<div class="app-container"  :style="`height:${height}px`">
   <el-empty description="页面开发中..."></el-empty>
 </div>
 </template>
 
 <script>
 export default {
-  name: "lock-xx"
+  name: "lock-xx",
+  data(){
+    return{
+      height: document.body.clientHeight - 155,
+    }
+  },mounted() {
+    window.onresize = () => {    //写在mounted中,onresize事件会在页面大小被调整时触发
+      return (() => {
+        window.screenHeight = document.body.clientHeight - 155;
+        this.height = window.screenHeight;
+      })();
+    };
+
+  },
+  watch: {
+    height(val) {        //在watch中监听height,浏览器窗口大小变动时自适应高度。
+      this.height = val;
+      console.log(this.height, "新的高度");
+    },
+  },
 }
 </script>