universal-api icon indicating copy to clipboard operation
universal-api copied to clipboard

Universal apis for web and miniapps.

Results 30 universal-api issues
Sort by recently updated
recently updated
newest added

支付宝小程序用户信息相关 API 发生更新 ( https://forum.alipay.com/mini-app/post/73101020 ),需要单独适配 getOpenUserInfo

https://github.com/raxjs/universal-api/issues/272

使用@uni/request做jsonp请求的时候,JSONP请求返回异常如下: ![image](https://user-images.githubusercontent.com/35956145/176112676-3b7a385d-9fbe-4a92-8ea0-1c8d7b300905.png) 找到抛出异常的代码如下: ![image](https://user-images.githubusercontent.com/35956145/176112729-25f75add-22b0-49c2-98b9-630b563656e7.png) 从上面看出,抛出异常的一定是line:130 JSON.parse方法,然后看下异常返回的详细信息如下: ![image](https://user-images.githubusercontent.com/35956145/176112784-943e0597-2734-4514-b322-91b9150278ab.png) 从上图可以会导致代码冲突的,就是返回的“;”没有被替换掉。 那么,line: 129这种解码方式是有问题的,看下源码: ``` code const content = res?.data?.replace(`${jsonpCallback}(`, '').replace(')', ''); ``` 这里只是将)替换掉了,没有考虑到 ); 结尾的情况,并且使用replace的字符串替换是不严谨的,可能导致返回的数据里面本身的相同字符串被替换,应该使用正则匹配替换,代码如下: ``` code const reg = new RegExp(`(^${jsonpCallback}\\(|(\\)|\\);)$)`, 'gm');...

- [x] 新增 `@uni/utils` :将 utils 中非测试函数依赖移到 packages/utils 中,原 utils 中的 `__test__` 保持不变 - [ ] 更新所有用到了 `@utils/` 能力的组件包,使其依赖 `@uni/utils` 其中大包中不导出 utils

## 问题 在 Web 下, @uni/pull-down-refresh 提供了 onPullDownRefresh 现有代码对下拉处理不是全局单实例的,看起来目前只能开启全局的下拉和增加监听,无法移除下拉和删除监听 https://github.com/raxjs/universal-api/blob/master/src/packages/interactive/pullDownRefresh/src/web/onPullDownRefresh.ts#L184-L190 ## 期望 1. 期望支持关闭页面下拉功能 2. 期望支持移除下拉监听事件功能

这个问题在我很多同事的电脑上都出现,应该不是偶现 系统:mac | window(我同事是window) chrome 版本99 使用控制台的手机模拟器,选择任意iphone机型,走到关于IOS的判断里,是没有起作用的 ··· if (isOS()) { range = document.createRange(); range.selectNodeContents(textArea); selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(range); textArea.setSelectionRange(0, 999999); } else { textArea.select(); } ···

- 将 `src/utils` 发成 npm 包 原因:在构建产物中 promisify 代码重复出现了很多次,在仓库中尝试搜索 `utils/promisify` 可以发现 20+ 处引用

@uni/storage 缺少 getStorageInfo & getStorageInfoSync 方法