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

h5端Taro.getApp()返回undefined #9585

Closed
MrSSK0313 opened this issue Jun 22, 2021 · 0 comments
Closed

h5端Taro.getApp()返回undefined #9585

MrSSK0313 opened this issue Jun 22, 2021 · 0 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@MrSSK0313
Copy link

相关平台

H5

浏览器版本: Chrome 91.0.4472.106
使用框架: React

复现步骤

class App extends Component {
taroGlobalData = {
x: 1
}
render () {
return this.props.children
}
}
根据官网给的还是返回undefined

期望结果

应该返回taroGlobalData 里面的内容

实际结果

undefined

环境信息

Taro CLI 3.2.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.14.9 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Jun 22, 2021
@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

1 participant