vue 高度 动态更新计算 calcHeight watch $route

Posted pengchenggang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 高度 动态更新计算 calcHeight watch $route相关的知识,希望对你有一定的参考价值。

vue 高度 动态更新计算

 calcHeight () {
      this.orgTreeHeight = window.innerHeight - 180
      // this.tableHeight = window.innerHeight - 210
      this.divHeight = window.innerHeight - 180
    }

  },
  mounted () {
    // console.info(‘jobOrgNum this‘, this)
    window.onresize = () => {
      this.calcHeight()
    }
  },
  watch: {
    $route (to, from) {
      this.calcHeight()
    }

 

以上是关于vue 高度 动态更新计算 calcHeight watch $route的主要内容,如果未能解决你的问题,请参考以下文章