|
@@ -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>
|
|
|
|