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

fix(weapp): 修复云开发 api 初始化 #2473

Merged
merged 1 commit into from
Mar 18, 2019

Conversation

js-newbee
Copy link
Contributor

基础库版本低于 2.2.3 时会报错,因为 wx.cloud 是 undefined,应该做下兼容处理

@jinjinjin0731
Copy link
Contributor

jinjinjin0731 commented Mar 18, 2019

兼容性问题
其实在模板层已经加上了 cloud 这个字段 https://github.com/NervJS/taro/blob/master/packages/taro-cli/templates/wxcloud/client/appjs#L37.

如果需要在这里加上兼容性处理的话,我觉得需要使用 canIUse 来做。

@js-newbee
Copy link
Contributor Author

@jinjinjin0731 问题是,我没有用到云开发,但只要我的基础库版本低于 2.2.3,运行就会报错,这个就不太合理了吧?

@Garfield550
Copy link
Collaborator

问题已复现...

image
image
image

@jinjinjin0731
Copy link
Contributor

@js-newbee 哎。。。有理。。thx
@Garfield550 thx

@jinjinjin0731 jinjinjin0731 merged commit 5edaefc into NervJS:master Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants