Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzb_79
uni-app
提交
9c343b09
U
uni-app
项目概览
lzb_79
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9c343b09
编写于
4月 22, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(App): add requireGlobal
上级
44187725
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
41 addition
and
5 deletion
+41
-5
lib/apis.js
lib/apis.js
+2
-1
packages/uni-cli-shared/lib/uni-polyfill.js
packages/uni-cli-shared/lib/uni-polyfill.js
+14
-2
src/core/helpers/promise.js
src/core/helpers/promise.js
+1
-1
src/platforms/app-plus/service/api/index.js
src/platforms/app-plus/service/api/index.js
+2
-1
src/platforms/app-plus/service/api/plugin/require-global.js
src/platforms/app-plus/service/api/plugin/require-global.js
+22
-0
未找到文件。
lib/apis.js
浏览文件 @
9c343b09
...
...
@@ -237,6 +237,7 @@ const third = [
'
requireNativePlugin
'
,
'
upx2px
'
,
'
restoreGlobal
'
,
'
requireGlobal
'
,
'
getSubNVueById
'
,
'
getCurrentSubNVue
'
,
'
setPageMeta
'
,
...
...
@@ -282,4 +283,4 @@ const apis = [
...
plugin
]
module
.
exports
=
apis
module
.
exports
=
apis
packages/uni-cli-shared/lib/uni-polyfill.js
浏览文件 @
9c343b09
...
...
@@ -12,6 +12,18 @@ if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
})
}
}
if
(
uni
.
base64ToArrayBuffer
)
{
ArrayBuffer
=
uni
.
base64ToArrayBuffer
(
''
).
constructor
if
(
typeof
uni
!==
'
undefined
'
&&
uni
&&
uni
.
requireGlobal
)
{
const
global
=
uni
.
requireGlobal
()
ArrayBuffer
=
global
.
ArrayBuffer
Int8Array
=
global
.
Int8Array
Uint8Array
=
global
.
Uint8Array
Uint8ClampedArray
=
global
.
Uint8ClampedArray
Int16Array
=
global
.
Int16Array
Uint16Array
=
global
.
Uint16Array
Int32Array
=
global
.
Int32Array
Uint32Array
=
global
.
Uint32Array
Float32Array
=
global
.
Float32Array
Float64Array
=
global
.
Float64Array
BigInt64Array
=
global
.
BigInt64Array
BigUint64Array
=
global
.
BigUint64Array
}
src/core/helpers/promise.js
浏览文件 @
9c343b09
...
...
@@ -8,7 +8,7 @@ import {
}
from
'
./interceptor
'
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
/^
\$
|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|
requireGlobal|
getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback/
const
CONTEXT_API_RE
=
/^create|Manager$/
...
...
src/platforms/app-plus/service/api/index.js
浏览文件 @
9c343b09
...
...
@@ -50,6 +50,7 @@ export * from './plugin/push'
export
*
from
'
./plugin/require-native-plugin
'
export
*
from
'
./plugin/share
'
export
*
from
'
./plugin/restore-global
'
export
*
from
'
./plugin/require-global
'
export
*
from
'
./plugin/sub-nvue
'
export
*
from
'
./plugin/on-native-event-receive
'
export
*
from
'
./plugin/send-native-event
'
...
...
@@ -83,4 +84,4 @@ export * from './ad/ad'
export
*
from
'
./ad/rewarded-video-ad
'
export
*
from
'
./ad/full-screen-video-ad
'
export
*
from
'
./ad/interstitial-ad
'
export
*
from
'
./ad/interactive-ad
'
export
*
from
'
./ad/interactive-ad
'
src/platforms/app-plus/service/api/plugin/require-global.js
0 → 100644
浏览文件 @
9c343b09
export
function
requireGlobal
()
{
const
list
=
[
'
ArrayBuffer
'
,
'
Int8Array
'
,
'
Uint8Array
'
,
'
Uint8ClampedArray
'
,
'
Int16Array
'
,
'
Uint16Array
'
,
'
Int32Array
'
,
'
Uint32Array
'
,
'
Float32Array
'
,
'
Float64Array
'
,
'
BigInt64Array
'
,
'
BigUint64Array
'
,
]
const
object
=
{}
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
const
key
=
list
[
i
]
object
[
key
]
=
global
[
key
]
}
return
object
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录