setPageOrientation 切换横竖屏

setPageOrientation ^8.6

切换横竖屏

#请求参数 object

Prop Type Default Comment
orientation Number N/A 0:强制竖屏, 1:强制横屏(但会根据不同的横向展示方向调整横屏方向)

#引入接口模块

import bridge from '@minix-iot/etsbridge-sdk'

#接口调用示例

const params = {
  orientation: 0,
}

bridge
  .setPageOrientation(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(err)
  })

#返回参数

  • 成功时返回 Object res
Prop Type Value
code Number 0: 成功 -2: "json 解析失败"
msg String success
posted on 2024-12-27 09:30  AtlasLapetos  阅读(24)  评论(0)    收藏  举报