问题:输入键盘弹起时会遮盖住底部的内容
解决:增加内容高度,然后页面滚动到底部
<InputItem [content]="'评分'" [type]="'money'" [placeholder]="'满分100分'" formControlName="Score" (onFocus)="scoreFocus()"(onBlur)="scoreBlur()" required> </InputItem> <div [ngStyle]="{'height': height}"></div>
scoreFocus() { this.height = '210px'; // 键盘弹出后-滚动到底部 setTimeout(() => { const container = document.querySelector('.container'); window.scrollTo(0, container.scrollHeight); }); } scoreBlur() { this.height = '64px'; }
标签:滚动,键盘,底部,container,弹起,页面 From: https://www.cnblogs.com/tingying/p/17032453.html