动态获取页面高度 改变盒子高度值

65 阅读1分钟
mounted() {
  let _this = this
  window.onresize = function (){
    _this.screenHeight = (document.documentElement.clientHeight -60)*0.7 -170
  }
}

在data中获取页面高度 mouted中重新计算

screenHeight:(document.documentElement.clientHeight -60)*0.7 -160