• Vue 手机端监听屏幕的高度


      mounted() {
        this.judgePhone()
        //监听事件
        window.onresize = () => {
          return (() => {
            this.showHeight = document.documentElement.clientHeight || document.body.clientHeight;
            this.judgePhone()
          })()
        }

      },
     
        judgePhone() {
          let reg = /iphone/gi;
          let ag = navigator.userAgent.toLowerCase()
          let {screen} = window
          if (reg.test(ag) && screen.width === 375 && screen.height === 812) {
           this.$refs.login.style.backgroundPositionY='-20%'
            this.$refs.bottomText.style.bottom="15%";
          }else if(reg.test(ag)){
            this.$refs.login.style.backgroundPositionY='-50%'
            this.$refs.bottomText.style.bottom="5%";
          }
        },
     
     
    工作中如果有您解决不了的问题或者您花费2小时还没解决的问题,这里可以有偿帮您高效直接解决bug,wx号:18062748486,备注”bug解决“;
  • 相关阅读:
    python re模块
    python
    python
    Django学习手册
    Django学习手册
    前端
    前端
    Django学习手册
    前端
    Database学习
  • 原文地址:https://www.cnblogs.com/emmawang1988/p/16284215.html
Copyright © 2020-2023  润新知