支付寶小程序API canIUse

2018-11-27 19:45 更新

my.canIUse(String)

判斷當前小程序的 API、入?yún)⒒蚍祷刂?、組件、屬性等在當前版本是否支持。

參數(shù)使用 ${API}.${type}.${param}.${option} 或者 ${component}.${attribute}.${option} 方式來調用

  • API 表示 api 名字
  • type 取值 object/return/callback 表示 api 的判斷類型
  • param 表示參數(shù)的某一個屬性名
  • option 表示參數(shù)屬性的具體屬性值
  • 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')
以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號