更新时间:2020-07-07 19:42
判断当前小程序的 API、入参或返回值、组件、属性等在当前版本是否支持。
参数使用 ${API}.${type}.${param}.${option}
或者 ${component}.${attribute}.${option}
方式来调用。
// 新增 API 是否可用
my.canIUse('getFileInfo')
// API 新增属性是否可用
my.canIUse('closeSocket.object.code')
// API 新增属性是否可用
my.canIUse('getLocation.object.type')
// API 返回值新增属性是否可用
my.canIUse('getSystemInfo.return.brand')
// 新增组件「关注生活号」是否可用
my.canIUse('lifestyle')
// 组件新增属性值是否可用
my.canIUse('button.open-type.share')
为 Boolean 类型,表示是否支持。
在文档使用中是否遇到以下问题
更多建议
匿名提交