设置设备屏幕旋转方向 1.6.3版本开始生效

使用说明

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);
})

results matching ""

    No results matching ""