Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
michaellions
uni-app
提交
ff364ec2
U
uni-app
项目概览
michaellions
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff364ec2
编写于
4月 11, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
44ddf729
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
177 addition
and
48 deletion
+177
-48
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+22
-5
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+21
-6
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+21
-6
packages/uni-mp-lark/dist/uni.mp.esm.js
packages/uni-mp-lark/dist/uni.mp.esm.js
+21
-6
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+24
-6
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+21
-6
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+26
-7
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+21
-6
未找到文件。
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -374,9 +374,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
my
.
$subpackages
||
(
my
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
my
.
getLaunchOptionsSync
&&
my
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
my
.
onAppShow
)
{
my
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -387,10 +396,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
my
.
getLaunchOptionsSync
&&
my
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
my
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -581,9 +586,18 @@ function initBehaviors(vueOptions) {
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
my
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
my
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -598,6 +612,9 @@ function $destroyComponent(instance) {
function
initCreatePluginApp
(
parseAppOptions
)
{
return
function
createApp
(
vm
)
{
initAppLifecycle
(
parseApp
(
vm
,
parseAppOptions
),
vm
);
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
my
.
$vm
=
vm
;
}
};
}
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -401,9 +401,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
swan
.
$subpackages
||
(
swan
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
swan
.
getLaunchOptionsSync
&&
swan
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
swan
.
onAppShow
)
{
swan
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -414,10 +423,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
swan
.
getLaunchOptionsSync
&&
swan
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
swan
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -816,9 +821,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
swan
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
swan
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -1158,6 +1172,7 @@ swan.EventChannel = EventChannel;
swan
.
createApp
=
global
.
createApp
=
createApp
;
swan
.
createPage
=
createPage
;
swan
.
createComponent
=
createComponent
;
swan
.
createSubpackageApp
=
createSubpackageApp
;
swan
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -399,9 +399,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
ks
.
$subpackages
||
(
ks
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
ks
.
getLaunchOptionsSync
&&
ks
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
ks
.
onAppShow
)
{
ks
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -412,10 +421,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
ks
.
getLaunchOptionsSync
&&
ks
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
ks
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -803,9 +808,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
ks
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
ks
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -1053,6 +1067,7 @@ ks.EventChannel = EventChannel;
ks
.
createApp
=
global
.
createApp
=
createApp
;
ks
.
createPage
=
createPage
;
ks
.
createComponent
=
createComponent
;
ks
.
createSubpackageApp
=
createSubpackageApp
;
ks
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-lark/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -398,9 +398,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
tt
.
$subpackages
||
(
tt
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
tt
.
onAppShow
)
{
tt
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -411,10 +420,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
tt
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -776,9 +781,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
tt
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
tt
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -1113,6 +1127,7 @@ tt.EventChannel = EventChannel;
tt
.
createApp
=
global
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
tt
.
createSubpackageApp
=
createSubpackageApp
;
tt
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -395,9 +395,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
qq
.
$subpackages
||
(
qq
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
qq
.
getLaunchOptionsSync
&&
qq
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
qq
.
onAppShow
)
{
qq
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -408,10 +417,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
qq
.
getLaunchOptionsSync
&&
qq
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
qq
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -765,9 +770,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
qq
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
qq
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -815,6 +829,9 @@ function initCreatePage(parseOptions) {
function
initCreatePluginApp
(
parseAppOptions
)
{
return
function
createApp
(
vm
)
{
initAppLifecycle
(
parseApp
(
vm
,
parseAppOptions
),
vm
);
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
qq
.
$vm
=
vm
;
}
};
}
...
...
@@ -945,6 +962,7 @@ qq.EventChannel = EventChannel;
qq
.
createApp
=
global
.
createApp
=
createApp
;
qq
.
createPage
=
createPage
;
qq
.
createComponent
=
createComponent
;
qq
.
createSubpackageApp
=
createSubpackageApp
;
qq
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createPluginApp
,
createSubpackageApp
};
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -398,9 +398,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
tt
.
$subpackages
||
(
tt
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
tt
.
onAppShow
)
{
tt
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -411,10 +420,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
tt
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -777,9 +782,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
tt
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
tt
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -1135,6 +1149,7 @@ tt.EventChannel = EventChannel;
tt
.
createApp
=
global
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
tt
.
createSubpackageApp
=
createSubpackageApp
;
tt
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -332,9 +332,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
wx
.
$subpackages
||
(
wx
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
wx
.
getLaunchOptionsSync
&&
wx
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
wx
.
onAppShow
)
{
wx
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -345,10 +354,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
wx
.
getLaunchOptionsSync
&&
wx
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
wx
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -702,9 +707,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
wx
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
wx
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -752,6 +766,9 @@ function initCreatePage(parseOptions) {
function
initCreatePluginApp
(
parseAppOptions
)
{
return
function
createApp
(
vm
)
{
initAppLifecycle
(
parseApp
(
vm
,
parseAppOptions
),
vm
);
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
wx
.
$vm
=
vm
;
}
};
}
...
...
@@ -881,8 +898,10 @@ const createSubpackageApp = initCreateSubpackageApp();
wx
.
createApp
=
global
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
wx
.
createPluginApp
=
createPluginApp
;
wx
.
createSubpackageApp
=
createSubpackageApp
;
wx
.
createPluginApp
=
global
.
createPluginApp
=
createPluginApp
;
wx
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
}
export
{
createApp
,
createComponent
,
createPage
,
createPluginApp
,
createSubpackageApp
};
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
ff364ec2
...
...
@@ -460,9 +460,18 @@ function initCreateSubpackageApp(parseAppOptions) {
}
});
initAppLifecycle
(
appOptions
,
vm
);
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
(
qa
.
$subpackages
||
(
qa
.
$subpackages
=
{}))[
process
.
env
.
UNI_SUBPACKAGE
]
=
{
$vm
:
vm
,
};
}
};
}
function
initAppLifecycle
(
appOptions
,
vm
)
{
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
qa
.
getLaunchOptionsSync
&&
qa
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
(
args
);
}
if
(
isFunction
(
appOptions
.
onShow
)
&&
qa
.
onAppShow
)
{
qa
.
onAppShow
((
args
)
=>
{
vm
.
$callHook
(
'
onShow
'
,
args
);
...
...
@@ -473,10 +482,6 @@ function initAppLifecycle(appOptions, vm) {
vm
.
$callHook
(
'
onHide
'
,
args
);
});
}
if
(
isFunction
(
appOptions
.
onLaunch
))
{
const
args
=
qa
.
getLaunchOptionsSync
&&
qa
.
getLaunchOptionsSync
();
vm
.
$callHook
(
'
onLaunch
'
,
args
||
{});
}
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
qa
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
...
...
@@ -819,9 +824,18 @@ function initCreateComponent(parseOptions) {
}
let
$createComponentFn
;
let
$destroyComponentFn
;
function
getAppVm
()
{
if
(
process
.
env
.
UNI_MP_PLUGIN
)
{
return
qa
.
$vm
;
}
if
(
process
.
env
.
UNI_SUBPACKAGE
)
{
return
qa
.
$subpackages
[
process
.
env
.
UNI_SUBPACKAGE
].
$vm
;
}
return
getApp
().
$vm
;
}
function
$createComponent
(
initialVNode
,
options
)
{
if
(
!
$createComponentFn
)
{
$createComponentFn
=
getApp
().
$vm
.
$createComponent
;
$createComponentFn
=
getApp
Vm
()
.
$createComponent
;
}
const
proxy
=
$createComponentFn
(
initialVNode
,
options
);
return
getExposeProxy
(
proxy
.
$
)
||
proxy
;
...
...
@@ -1155,6 +1169,7 @@ qa.EventChannel = EventChannel$1;
qa
.
createApp
=
global
.
createApp
=
createApp
;
qa
.
createPage
=
createPage
;
qa
.
createComponent
=
createComponent
;
qa
.
createSubpackageApp
=
createSubpackageApp
;
qa
.
createSubpackageApp
=
global
.
createSubpackageApp
=
createSubpackageApp
;
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录