# setScreenOrientation

> 设置屏幕方向

### setScreenOrientation

> 设置屏幕方向

#### 请求参数

| 参数          | 类型                          | 必填 | 说明                   |
| ------------- | ----------------------------- | ---- | ---------------------- |
| `orientation` | `number`                      | 是   | 屏幕方向 0:竖屏 1:横屏 |
| `success`     | `() => void`                  | 否   | 成功回调               |
| `fail`        | `(error: BridgeCode) => void` | 否   | 失败回调               |
| `complete`    | `() => void`                  | 否   | 完成回调               |

#### 返回值

```js
Promise<void>
```

#### 示例代码

```js
import { setScreenOrientation } from '@kbapp/js-bridge'

// 设置为横屏
setScreenOrientation({
    orientation: 1,
    success() {
        console.log('设置横屏成功')
    },
    fail(error) {
        console.log('设置横屏失败', error)
    },
})

// 设置为竖屏
setScreenOrientation({
    orientation: 0,
    success() {
        console.log('设置竖屏成功')
    },
    fail(error) {
        console.log('设置竖屏失败', error)
    },
})
```

> 支持 Promise 风格调用
