canlUse版本可用性

canlUse ^6.8

获取某个 API 在当前版本是否可用

#请求参数

  • N/A

#接口调用示例

this.$bridge
  .canIUse('getDeviceInfo')
  .then(res => {    
  this.$alert(res)
  })
  .catch(err => {
  this.$toast(err)
  })

#返回参数

  • 成功时返回
Prop Type Value
enable Boolean `true
  • 失败时返回(api 为空或者没有)
Prop Type Value
code Number -2
msg json 解析失败

#返回示例

{
  "enabled": true //true or false
}
posted on 2024-12-12 09:18  AtlasLapetos  阅读(19)  评论(0)    收藏  举报