We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序
https://github.com/github177/taroTest 小程序基础库: 2.14.3 使用框架: React
下载代码之后 npm i 然后运行 npm run dev:weapp
在微信开发者工具中打开
打开之后支持调用 startGyroscope 监听陀螺仪
代码做了判断,不做判断的话会报错 Taro.startGyroscope is not a function. 因此无法调用陀螺仪。
👽 Taro v3.0.23 Taro CLI 3.0.23 environment info: System: OS: Windows 10 Binaries: Node: 14.15.3 - C:\Program Files\nodejs\node.EXE npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
我找到了原因所在,以及解决办法,如下:
在 node_modules@tarojs\api\dist\index.esm.js 这个文件里面添加如下代码即可解决此问题:
startGyroscope: true, stopGyroscope: true,
onGyroscopeChange: true,
希望官方能尽早修复此问题,感谢!
The text was updated successfully, but these errors were encountered:
feat(taro-api): add gyroscope related apis (NervJS#8496)
776130d
feat(taro-api): add gyroscope related apis (#8496) (#8497)
14f0d71
Successfully merging a pull request may close this issue.
相关平台
微信小程序
复现仓库
https://github.com/github177/taroTest
小程序基础库: 2.14.3
使用框架: React
复现步骤
下载代码之后 npm i 然后运行 npm run dev:weapp
在微信开发者工具中打开
期望结果
打开之后支持调用 startGyroscope 监听陀螺仪
实际结果
代码做了判断,不做判断的话会报错 Taro.startGyroscope is not a function. 因此无法调用陀螺仪。
环境信息
补充信息
我找到了原因所在,以及解决办法,如下:
在 node_modules@tarojs\api\dist\index.esm.js 这个文件里面添加如下代码即可解决此问题:
startGyroscope: true,
stopGyroscope: true,
onGyroscopeChange: true,
希望官方能尽早修复此问题,感谢!
The text was updated successfully, but these errors were encountered: