但是这样写就会导致键盘弹出的时候html和body的高度从原来的100%变为(100%-键盘高度),这样的话main的height:100%也会变成(100%-键盘高度),所以需要强行将main的高度设置为html原本的100%。
<input
id="searchInput"
type="text"
class="search-input"
:placeholder=""
v-model="search"
@input="input()"
@change="change()"
/>
change () {
let nth = document.getElementById('searchInput');
nth.blur();
window.onload = function () {
var style1 = document.getElementById('global-css');
style1.innerHTML = 'body, html{ max-height: 100vh; height: 100vh }';
}
},