//scrollIntoViewIfNeeded、scrollIntoView 需要考虑兼容性。 const ua = window.navigator.userAgent.toLocaleLowerCase(); const isAndroid = /android/.test(ua); if (isAndroid) { setTimeout(() => { this.$refs.inputRef.scrollIntoViewIfNeeded(); }, 0); } or // 安卓下键盘弹出会触发window.resize事件,document.body.clientHeight会改变
or