# canlUse ^6.8
获取某个 API 在当前版本是否可用
# 请求参数
- N/A
# 接口调用示例
this.$bridge
  .canIUse('getDeviceInfo')
  .then(res => {    
  this.$alert(res)
  })
  .catch(err => {
  this.$toast(err)
  })
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 返回参数
- 成功时返回
| Prop | Type | Value | 
|---|---|---|
| enable | Boolean | true|false | 
- 失败时返回(api 为空或者没有)
| Prop | Type | Value | 
|---|---|---|
| code | Number | -2 | 
| msg | json 解析失败 | 
# 返回示例
{
  "enabled": true //true or false
}
1
2
3
2
3
