Skip to content
New issue

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

Taro.getBatteryInfo API 无法使用 #7846

Closed
fayeah opened this issue Oct 15, 2020 · 0 comments · Fixed by #7882
Closed

Taro.getBatteryInfo API 无法使用 #7846

fayeah opened this issue Oct 15, 2020 · 0 comments · Fixed by #7882
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@fayeah
Copy link

fayeah commented Oct 15, 2020

相关平台

微信小程序

小程序基础库: 2.11.3
使用框架: React

复现步骤

调用Taro.getBatteryInfo,刷新微信小程序工具,看到error log。

期望结果

能够正常调用getBatteryInfo并且拿到正确的电量信息。

实际结果

报错:

image

环境信息

👽 Taro v3.0.14


  Taro CLI 3.0.14 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.4.0 - ~/.nvm/versions/node/v12.4.0/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.13.2 - ~/.nvm/versions/node/v12.4.0/bin/npm
    npmPackages:
      @tarojs/components: 3.0.14 => 3.0.14
      @tarojs/mini-runner: 3.0.14 => 3.0.14
      @tarojs/react: 3.0.14 => 3.0.14
      @tarojs/runtime: 3.0.14 => 3.0.14
      @tarojs/taro: 3.0.14 => 3.0.14
      @tarojs/webpack-runner: 3.0.14 => 3.0.14
      babel-preset-taro: 3.0.14 => 3.0.14
      eslint-config-taro: 3.0.14 => 3.0.14
      react: ^16.10.0 => 16.13.1
    npmGlobalPackages:
      typescript: 3.5.3

补充信息

在Taro项目工程里面使用 wx.getBatteryInfo() 是可以正常使用的

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Oct 15, 2020
@Chen-jj Chen-jj added this to the 3.0.15 milestone Oct 16, 2020
@Chen-jj Chen-jj linked a pull request Oct 21, 2020 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants