设置为true可以在键盘出现时缩小WebView。WebView收缩,而不是视口收缩和页面可滚动。
import { KeyboardExt } from "@yl/super-jssdk"
KeyboardExt.shrinkView(optional)
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| optional | Object | 否 | 选填参数 |
optional
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| value | boolean | 否 | 是否在键盘出现时缩小WebView,默认 false |
| 参数 | 类型 | 作用 |
|---|---|---|
| resolve() | Function | 成功回调 |
| reject(err) | Function | 失败回调,err为详细错误信息,是一个json对象,例如:{"errCode":-1,"errMsg":"出错啦"} |
KeyboardExt.shrinkView()
.then(() => {
console.log();
})
.catch(err => {
console.log('插件调用失败:', err)
})