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()
    }

 

posted @ 2019-02-26 12:00  彭成刚  阅读(2404)  评论(0编辑  收藏  举报