zoukankan      html  css  js  c++  java
  • 移动端 提交按钮呗软键盘挤上去的问题解决

     data() {
        return {
          docmHeight: document.documentElement.clientHeight,
          showHeight: document.documentElement.clientHeight,
          hideClass: false,
        }
      },
     
    methods{
    // 检测屏幕高度变化
        inputType() {
          if (!this.timer) {
            this.timer = true
            const that = this
            setTimeout(() => {
              if (that.docmHeight > that.showHeight) {
              // 显示class
                this.hideClass = true
              } else if (that.docmHeight <= that.showHeight) {
                // 显示隐藏
                this.hideClass = false
              }
              that.timer = false
            }, 20)
          }
        },
    }
     mounted() {
        // window.onresize监听页面高度的变化
        window.onresize = () => (() => {
          window.screenHeight = document.body.clientHeight
          this.showHeight = window.screenHeight
        })()
      },
  • 相关阅读:
    hdu 1163 Eddy's digital Roots (数学)
    hdu 2546 饭卡 (01背包)
    hdu 1059 Dividing(多重DP)
    晚霞
    最佳学习方法
    [备忘]求两数最大公约,最小公倍数
    不眠的夏夜
    超女唱《八荣八耻》:好完美的恶搞啊
    公司展会上的德国MM
    我玩游戏
  • 原文地址:https://www.cnblogs.com/wsj1/p/14148812.html
Copyright © 2011-2022 走看看