监听浏览器窗口大小

  mounted() {
    this.$nextTick(this.getBodyHeight)
    window.addEventListener('resize', this.getBodyHeight)

  },
  methods: {
    getBodyHeight() {
      this.bodyHeight = window.innerHeight - 48
    },
}

  

posted on 2023-03-06 17:01  稳住别慌  阅读(22)  评论(0编辑  收藏  举报