Taro.canIUse(String)

使用方式同 wx.canIUse

示例代码

  1. import Taro from '@tarojs/taro'
  2. Taro.canIUse('openBluetoothAdapter')
  3. Taro.canIUse('getSystemInfoSync.return.screenWidth')
  4. Taro.canIUse('getSystemInfo.success.screenWidth')
  5. Taro.canIUse('showToast.object.image')
  6. Taro.canIUse('onCompassChange.callback.direction')
  7. Taro.canIUse('request.object.method.GET')
  8. Taro.canIUse('live-player')
  9. Taro.canIUse('text.selectable')
  10. Taro.canIUse('button.open-type.contact')

API支持度

API微信小程序H5React Native
Taro.canIUse✔️