# setWebViewTitle

> 设置网页标题

### setWebViewTitle

> 设置网页标题(建议通过 document.title 设置)

#### 请求参数

| 参数       | 类型                          | 必填 | 说明             |
| ---------- | ----------------------------- | ---- | ---------------- |
| `title`    | `string`                      | 是   | webview 标题文案 |
| `success`  | `() => void`                  | 否   | 成功回调         |
| `fail`     | `(error: BridgeCode) => void` | 否   | 失败回调         |
| `complete` | `() => void`                  | 否   | 完成回调         |

#### 返回值

```js
Promise<void>
```

#### 异常返回值

```js
Promise<{ errCode: BridgeCode }>
```

#### 示例代码

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

setWebViewTitle({
    title: '页面标题',
    success() {
        console.log('设置标题成功')
    },
    fail(error) {
        console.log('设置标题失败', error)
    },
})
```

> 支持 Promise 风格调用
