Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
101f8219
U
uni-app
项目概览
DCloud
/
uni-app
4 个月 前同步成功
通知
726
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
101f8219
编写于
8月 16, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
d2e80217
变更
13
展开全部
显示空白变更内容
内联
并排
Showing
13 changed file
with
291 addition
and
8 deletion
+291
-8
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+25
-0
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+3
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+25
-6
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+25
-0
packages/uni-mp-jd/dist/index.js
packages/uni-mp-jd/dist/index.js
+25
-0
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+25
-0
packages/uni-mp-lark/dist/index.js
packages/uni-mp-lark/dist/index.js
+31
-0
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+25
-0
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+31
-0
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+25
-0
packages/uni-mp-xhs/dist/index.js
packages/uni-mp-xhs/dist/index.js
+25
-0
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+25
-0
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1147,6 +1147,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -1810,6 +1833,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
wx
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2084,6 +2108,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent$1
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$2
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
101f8219
...
...
@@ -6542,7 +6542,8 @@ var serviceContext = (function () {
const {
hostPackageName, hostName, osLanguage,
hostVersion, hostLanguage, hostTheme,
appId, appName, appVersion, appVersionCode
appId, appName, appVersion, appVersionCode,
appWgtVersion
} = systemInfo;
const appLanguage = uni
...
...
@@ -6556,6 +6557,7 @@ var serviceContext = (function () {
appName,
appVersion,
appVersionCode,
appWgtVersion,
appLanguage,
enableDebug: false,
hostSDKVersion: undefined,
...
...
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
101f8219
此差异已折叠。
点击以展开。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1387,12 +1387,6 @@ const protocols = { // 需要做转换的 API 列表
hideHomeButton
:
{
name
:
'
hideBackHome
'
},
saveImageToPhotosAlbum
:
{
name
:
'
saveImage
'
,
args
:
{
filePath
:
'
url
'
}
},
saveVideoToPhotosAlbum
:
{
args
:
{
filePath
:
'
src
'
...
...
@@ -1993,6 +1987,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2616,6 +2633,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
my
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -3091,6 +3109,7 @@ function parsePage (vuePageOptions) {
};
initHooks
(
pageOptions
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
,
vuePageOptions
);
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1610,6 +1610,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2273,6 +2296,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
swan
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2638,6 +2662,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-jd/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1227,6 +1227,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -1945,6 +1968,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
jd
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2212,6 +2236,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent$1
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1395,6 +1395,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2032,6 +2055,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
ks
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2344,6 +2368,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent$1
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-lark/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1445,6 +1445,35 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
if
(
hook
===
'
onError
'
)
{
return
getApp
().
$vm
.
$callHook
(
hook
,
args
)
}
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2089,6 +2118,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
tt
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2439,6 +2469,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1556,6 +1556,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2198,6 +2221,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
wx
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2466,6 +2490,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent$1
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1652,6 +1652,35 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
if
(
hook
===
'
onError
'
)
{
return
getApp
().
$vm
.
$callHook
(
hook
,
args
)
}
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2296,6 +2325,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
tt
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2680,6 +2710,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1378,6 +1378,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -2045,6 +2068,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
wx
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2312,6 +2336,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
packages/uni-mp-xhs/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1225,6 +1225,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -1943,6 +1966,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
xhs
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2192,6 +2216,7 @@ function parsePage (vuePageOptions) {
};
initHooks
(
pageOptions
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
,
vuePageOptions
);
if
(
Array
.
isArray
(
vueOptions
.
wxsCallMethods
))
{
vueOptions
.
wxsCallMethods
.
forEach
(
callMethod
=>
{
...
...
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
101f8219
...
...
@@ -1396,6 +1396,29 @@ function initHooks (mpOptions, hooks, vueOptions) {
});
}
function
initUnknownHooks
(
mpOptions
,
vueOptions
,
excludes
=
[])
{
findHooks
(
vueOptions
).
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
function
findHooks
(
vueOptions
,
hooks
=
[])
{
if
(
vueOptions
)
{
Object
.
keys
(
vueOptions
).
forEach
((
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
&&
isFn
(
vueOptions
[
name
]))
{
hooks
.
push
(
name
);
}
});
}
return
hooks
}
function
initHook$1
(
mpOptions
,
hook
,
excludes
)
{
if
(
excludes
.
indexOf
(
hook
)
===
-
1
&&
!
hasOwn
(
mpOptions
,
hook
))
{
mpOptions
[
hook
]
=
function
(
args
)
{
return
this
.
$vm
&&
this
.
$vm
.
__call_hook
(
hook
,
args
)
};
}
}
function
initVueComponent
(
Vue
,
vueOptions
)
{
vueOptions
=
vueOptions
.
default
||
vueOptions
;
let
VueComponent
;
...
...
@@ -1978,6 +2001,7 @@ function parseBaseApp (vm, {
initAppLocale
(
Vue
,
vm
,
normalizeLocale
(
qa
.
getSystemInfoSync
().
language
)
||
LOCALE_EN
);
initHooks
(
appOptions
,
hooks
);
initUnknownHooks
(
appOptions
,
vm
.
$options
);
return
appOptions
}
...
...
@@ -2335,6 +2359,7 @@ function parseBasePage (vuePageOptions, {
const
pageOptions
=
parseComponent
(
vuePageOptions
);
initHooks
(
pageOptions
.
methods
,
hooks$1
,
vuePageOptions
);
initUnknownHooks
(
pageOptions
.
methods
,
vuePageOptions
);
pageOptions
.
methods
.
onLoad
=
function
(
query
)
{
this
.
options
=
query
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录