# scanQRCode

> 扫描二维码

### scanQRCode

> 扫描二维码

#### 请求参数

| 参数       | 类型                          | 必填 | 说明                   |
| ---------- | ----------------------------- | ---- | ---------------------- |
| `success`  | `(res: string) => void`       | 否   | 成功回调，返回扫描结果 |
| `fail`     | `(error: BridgeCode) => void` | 否   | 失败回调               |
| `complete` | `() => void`                  | 否   | 完成回调               |

#### 返回值

```js
Promise<string>
```

#### 示例代码

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

scanQRCode({
    success(result) {
        console.log('扫描结果', result)
    },
    fail(error) {
        console.log('扫描失败', error)
    },
})
```

> 支持 Promise 风格调用
