移动端input输入的时候固定的底部被键盘顶上去解决方法

methods: {
      onFocus (key) {
        var ele = document.getElementsByClassName('button_footer')[0]
        ele.style.position = 'static'
        ele.style.marginTop = '4.68rem'
        ele.style.width = '100%'
      },
      onBlur () {
        var ele = document.getElementsByClassName('button_footer')[0]
        ele.style.position = 'fixed'
        ele.style.bottom = '0.88rem'
        ele.style.width = 'calc(100% - 0.8rem)'
      }
}
 .button_footer {
      position: fixed;
      bottom: 0.88rem;
      width: calc(100% - 0.8rem);
      right: 0.4rem;
      left: 0.4rem;
      box-sizing: border-box;
}

 

你可能感兴趣的:(移动端input输入的时候固定的底部被键盘顶上去解决方法)