mounted() {
    const that = this
    window.onresize = () => {
      return (() => {
        window.screenWidth = window.innerWidth
        this.screenWidth = window.screenWidth
      })()
    }
  }
  watch: {
    // 监听浏览器窗口宽度,当浏览器窗口小于1325时,隐藏系统时间
    screenWidth(val) {
      if (val < 1325) {
        this.$store.dispatch('handleHideSystemTime')
      } else {
        this.$store.dispatch('handleShowSystemTime')
      }
    }
  },
Logo

前往低代码交流专区

更多推荐