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

vite打包: uni-app@2 和 @3 版本中的 uni.request 返回类型不一致? #3076

Closed
sufuwang opened this issue Dec 15, 2021 · 8 comments
Assignees

Comments

@sufuwang
Copy link

uni-app@2 的 uni.request 有返回 error ,类型 [error, data] = await uni.request ,uni-app@3 不再返回 error 嘛 ?
类型声明文件并未体现这一改动,请问类似的这种改动,应该在哪里看呀?
还有就是想问 uni.request 代码在哪个文件中啊,没有找到

@fxy060608
Copy link
Collaborator

@sufuwang
Copy link
Author

大佬,有没有修改 ts 类型声明文件的计划,因为 await uni.request 返回的类型不对

image
image

@sufuwang
Copy link
Author

或者我提个 pr ,把成功回调和失败回调的类型导出,我在业务代码里面修改

@fxy060608
Copy link
Collaborator

fxy060608 commented Dec 15, 2021

或者我提个 pr ,把成功回调和失败回调的类型导出,我在业务代码里面修改

目前还未调整 promise 返回值,稍后提供支持
你可以在自己项目里临时解决一下

@zhetengbiji zhetengbiji self-assigned this Dec 15, 2021
@sufuwang
Copy link
Author

好的 👌

@sufuwang
Copy link
Author

大佬,onLoad 的类型是不是也有问题

image

@sufuwang sufuwang reopened this Dec 15, 2021
@fxy060608
Copy link
Collaborator

大佬,onLoad 的类型是不是也有问题

image

你是说缺少参数吗?

@sufuwang
Copy link
Author

对的,onLoad 的 hook 缺少参数

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

No branches or pull requests

3 participants