title: Taro.startCompass(param)

sidebar_label: startCompass

开始监听罗盘数据。

使用方式同 wx.startCompass

参数

object param

Param Type Description
[success] function 接口调用成功的回调函数
[fail] function 接口调用失败的回调函数
[complete] function 接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

  1. import Taro from '@tarojs/taro'
  2. Taro.startCompass()

API支持度

API 微信小程序 H5 React Native
Taro.startCompass ✔️ ✔️