阅读(3247) (0)

支付宝小程序API canIUse

2017-11-27 19:43:39 更新

my.canIUse(String)

判断当前小程序的 API、入参或返回值、组件、属性等在当前版本是否支持。

参数使用 ${API}.${type}.${param}.${option} 或者 ${component}.${attribute}.${option} 方式来调用

  • API 表示 api 名字
  • type 取值 object/return/callback 表示 api 的判断类型
  • param 表示参数的某一个属性名
  • option 表示参数属性的具体属性值
  • component 表示组件名称
  • attribute 表示组件属性名
  • option 表示组件属性值

示例代码

my.canIUse('getFileInfo')
my.canIUse('closeSocket.object.code')
my.canIUse('getLocation.object.type')
my.canIUse('getSystemInfo.return.brand')
my.canIUse('lifestyle')
my.canIUse('button.open-type.share')