import { MUtils } from '@yl/super-jssdk';
MUtils.setDeviceOrientation(optional)
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| optional | Object | 否 | 非必选参数 |
optional
| 参数 | 类型 | 必填 | 作用 |
|---|---|---|---|
| orientation | string | 否 | 屏幕旋转方向,可选值:portrait, landscape; portrait:竖屏; landscape:横屏。 默认 portrait |
| 参数 | 类型 | 作用 |
|---|---|---|
| resolve | Function | 成功回调 |
| reject | Function | 失败回调。参数为一个合法的json对象,例如:{"errCode": -1, "errMsg":"some explain of error."}。 |
MUtils.setDeviceOrientation({
orientation: "landscape"
}).then(res => {
console.log('res', res);
}).catch(err => {
console.log('err', err);
})