Wechat soft keyboard pops up to block the bottom

when you use vue to develop a Wechat web page and evoke a soft keyboard, the bottom will be squeezed up.

both methods are ineffective at present

  1. hide the bottom with the window.onresize listening page change control in mounted, but after it is executed only once, it is not executed.
  2. add focus and blur events to input to control the bottom display and hide, but not if you manually turn off the bottom of the keyboard on the soft keyboard.

is there a better way

Mobile phone is Xiaomi 6

Apr.03,2021

is finally solved. In fact, in Wechat's browser, the value of document.body.offsetHeight changes after evoking the soft keyboard, so listening for resize events in mounted can achieve the requirements.

Menu