Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
2027fe7f
U
uni-app
项目概览
MuGuiLin
/
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,发现更多精彩内容 >>
提交
2027fe7f
编写于
7月 19, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(mp): build
上级
16f7cbd1
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
4505 addition
and
268 deletion
+4505
-268
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+62
-45
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+65
-49
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+59
-43
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+60
-44
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+4140
-0
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+59
-43
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+60
-44
未找到文件。
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
...
...
@@ -122,19 +122,56 @@ function initMocks(instance, mpInstance, mocks) {
});
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
// lifecycle
// App and Page
const
ON_SHOW
=
'
onShow
'
;
const
ON_HIDE
=
'
onHide
'
;
//App
const
ON_LAUNCH
=
'
onLaunch
'
;
const
ON_ERROR
=
'
onError
'
;
const
ON_THEME_CHANGE
=
'
onThemeChange
'
;
const
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_BACK_PRESS
=
'
onBackPress
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
PAGE_HOOKS
=
[
'
onLoad
'
,
'
onShow
'
,
// 'onReady', // lifetimes.ready
'
onHide
'
,
'
onUnload
'
,
'
onResize
'
,
// 'onPageScroll', // 影响性能,开发者手动注册
'
onTabItemTap
'
,
'
onReachBottom
'
,
'
onPullDownRefresh
'
,
// 'onShareTimeline', // 右上角菜单,开发者手动注册
'
onAddToFavorites
'
,
ON_LOAD
,
ON_SHOW
,
ON_HIDE
,
ON_UNLOAD
,
ON_RESIZE
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_ADD_TO_FAVORITES
,
];
function
findHooks
(
vueOptions
,
hooks
=
new
Set
())
{
if
(
vueOptions
)
{
...
...
@@ -162,7 +199,7 @@ function initHook(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
'
onReady
'
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -171,12 +208,12 @@ function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
}
const
HOOKS
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onUnhandledRejection
'
,
ON_SHOW
,
ON_HIDE
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
...
...
@@ -195,7 +232,7 @@ function parseApp(instance, parseAppOptions) {
slots
:
[],
});
ctx
.
globalData
=
this
.
globalData
;
instance
.
$callHook
(
'
onLaunch
'
,
options
);
instance
.
$callHook
(
ON_LAUNCH
,
options
);
},
};
const
vueOptions
=
instance
.
$
.
type
;
...
...
@@ -216,26 +253,6 @@ function initCreateApp(parseAppOptions) {
};
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
function
initVueIds
(
vueIds
,
mpInstance
)
{
if
(
!
vueIds
)
{
return
;
...
...
@@ -870,7 +887,7 @@ function initChildVues(mpInstance) {
}
initChildVues
(
childMPInstance
);
childMPInstance
.
$vm
.
$callHook
(
'
mounted
'
);
childMPInstance
.
$vm
.
$callHook
(
'
onReady
'
);
childMPInstance
.
$vm
.
$callHook
(
ON_READY
);
});
}
delete
mpInstance
.
_$childVues
;
...
...
@@ -977,23 +994,23 @@ function createPage(vueOptions) {
// 初始化 vue 实例
this
.
$vm
=
createVueComponent
(
'
page
'
,
this
,
vueOptions
);
initSpecialMethods
(
this
);
this
.
$vm
.
$callHook
(
'
onLoad
'
,
query
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
},
onReady
()
{
initChildVues
(
this
);
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
'
onReady
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
},
onUnload
()
{
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
'
onUnload
'
);
this
.
$vm
.
$callHook
(
ON_UNLOAD
);
$destroyComponent
(
this
.
$vm
);
}
},
events
:
{
// 支付宝小程序有些页面事件只能放在events下
onBack
()
{
this
.
$vm
.
$callHook
(
'
onBackPress
'
);
this
.
$vm
.
$callHook
(
ON_BACK_PRESS
);
},
},
__r
:
handleRef
,
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
...
...
@@ -113,19 +113,55 @@ function initMocks(instance, mpInstance, mocks) {
});
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
// lifecycle
// App and Page
const
ON_SHOW
=
'
onShow
'
;
const
ON_HIDE
=
'
onHide
'
;
//App
const
ON_LAUNCH
=
'
onLaunch
'
;
const
ON_ERROR
=
'
onError
'
;
const
ON_THEME_CHANGE
=
'
onThemeChange
'
;
const
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
PAGE_HOOKS
=
[
'
onLoad
'
,
'
onShow
'
,
// 'onReady', // lifetimes.ready
'
onHide
'
,
'
onUnload
'
,
'
onResize
'
,
// 'onPageScroll', // 影响性能,开发者手动注册
'
onTabItemTap
'
,
'
onReachBottom
'
,
'
onPullDownRefresh
'
,
// 'onShareTimeline', // 右上角菜单,开发者手动注册
'
onAddToFavorites
'
,
ON_LOAD
,
ON_SHOW
,
ON_HIDE
,
ON_UNLOAD
,
ON_RESIZE
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_ADD_TO_FAVORITES
,
];
function
findHooks
(
vueOptions
,
hooks
=
new
Set
())
{
if
(
vueOptions
)
{
...
...
@@ -153,7 +189,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
'
onReady
'
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -162,12 +198,12 @@ function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
}
const
HOOKS
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onUnhandledRejection
'
,
ON_SHOW
,
ON_HIDE
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
...
...
@@ -186,7 +222,7 @@ function parseApp(instance, parseAppOptions) {
slots
:
[],
});
ctx
.
globalData
=
this
.
globalData
;
instance
.
$callHook
(
'
onLaunch
'
,
options
);
instance
.
$callHook
(
ON_LAUNCH
,
options
);
},
};
const
vueOptions
=
instance
.
$
.
type
;
...
...
@@ -207,26 +243,6 @@ function initCreateApp(parseAppOptions) {
};
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
}
...
...
@@ -803,7 +819,7 @@ function parsePage(vueOptions, parseOptions) {
this
.
$page
=
{
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
};
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
'
onLoad
'
,
query
);
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
};
initHooks
(
methods
,
PAGE_HOOKS
);
initUnknownHooks
(
methods
,
vueOptions
);
...
...
@@ -843,7 +859,7 @@ function initHook(name, options) {
}
}
Page
=
function
(
options
)
{
initHook
(
'
onLoad
'
,
options
);
initHook
(
ON_LOAD
,
options
);
return
MPPage
(
options
);
};
Component
=
function
(
options
)
{
...
...
@@ -857,7 +873,7 @@ function parse$2(appOptions) {
if
(
!
this
.
$vm
)
{
this
.
onLaunch
(
args
);
}
this
.
$vm
.
$callHook
(
'
onShow
'
,
args
);
this
.
$vm
.
$callHook
(
ON_SHOW
,
args
);
};
}
...
...
@@ -898,7 +914,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
'
onReady
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
}
},
detached
()
{
...
...
@@ -945,8 +961,8 @@ function parse$1(componentOptions) {
const
pageInstance
=
this
.
pageinstance
;
pageInstance
.
$vm
=
this
.
$vm
;
if
(
hasOwn
(
pageInstance
,
'
_$args
'
))
{
this
.
$vm
.
$callHook
(
'
onLoad
'
,
pageInstance
.
_$args
);
this
.
$vm
.
$callHook
(
'
onShow
'
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
pageInstance
.
_$args
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
delete
pageInstance
.
_$args
;
}
}
...
...
@@ -983,15 +999,15 @@ function parse(pageOptions) {
// 纠正百度小程序生命周期methods:onShow在methods:onLoad之前触发的问题
methods
.
onShow
=
function
onShow
()
{
if
(
this
.
$vm
&&
this
.
_$loaded
)
{
this
.
$vm
.
$callHook
(
'
onShow
'
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
}
};
methods
.
onLoad
=
function
onLoad
(
args
)
{
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
if
(
this
.
$vm
)
{
this
.
_$loaded
=
true
;
this
.
$vm
.
$callHook
(
'
onLoad
'
,
args
);
this
.
$vm
.
$callHook
(
'
onShow
'
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
args
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
}
else
{
this
.
pageinstance
.
_$args
=
args
;
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
...
...
@@ -113,19 +113,55 @@ function initMocks(instance, mpInstance, mocks) {
});
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
// lifecycle
// App and Page
const
ON_SHOW
=
'
onShow
'
;
const
ON_HIDE
=
'
onHide
'
;
//App
const
ON_LAUNCH
=
'
onLaunch
'
;
const
ON_ERROR
=
'
onError
'
;
const
ON_THEME_CHANGE
=
'
onThemeChange
'
;
const
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
PAGE_HOOKS
=
[
'
onLoad
'
,
'
onShow
'
,
// 'onReady', // lifetimes.ready
'
onHide
'
,
'
onUnload
'
,
'
onResize
'
,
// 'onPageScroll', // 影响性能,开发者手动注册
'
onTabItemTap
'
,
'
onReachBottom
'
,
'
onPullDownRefresh
'
,
// 'onShareTimeline', // 右上角菜单,开发者手动注册
'
onAddToFavorites
'
,
ON_LOAD
,
ON_SHOW
,
ON_HIDE
,
ON_UNLOAD
,
ON_RESIZE
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_ADD_TO_FAVORITES
,
];
function
findHooks
(
vueOptions
,
hooks
=
new
Set
())
{
if
(
vueOptions
)
{
...
...
@@ -153,7 +189,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
'
onReady
'
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -162,12 +198,12 @@ function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
}
const
HOOKS
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onUnhandledRejection
'
,
ON_SHOW
,
ON_HIDE
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
...
...
@@ -186,7 +222,7 @@ function parseApp(instance, parseAppOptions) {
slots
:
[],
});
ctx
.
globalData
=
this
.
globalData
;
instance
.
$callHook
(
'
onLaunch
'
,
options
);
instance
.
$callHook
(
ON_LAUNCH
,
options
);
},
};
const
vueOptions
=
instance
.
$
.
type
;
...
...
@@ -207,26 +243,6 @@ function initCreateApp(parseAppOptions) {
};
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
}
...
...
@@ -784,7 +800,7 @@ function parsePage(vueOptions, parseOptions) {
this
.
$page
=
{
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
};
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
'
onLoad
'
,
query
);
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
};
initHooks
(
methods
,
PAGE_HOOKS
);
initUnknownHooks
(
methods
,
vueOptions
);
...
...
@@ -824,7 +840,7 @@ function initHook(name, options) {
}
}
Page
=
function
(
options
)
{
initHook
(
'
onLoad
'
,
options
);
initHook
(
ON_LOAD
,
options
);
return
MPPage
(
options
);
};
Component
=
function
(
options
)
{
...
...
@@ -864,7 +880,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
'
onReady
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
}
},
detached
()
{
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
...
...
@@ -113,19 +113,55 @@ function initMocks(instance, mpInstance, mocks) {
});
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
// lifecycle
// App and Page
const
ON_SHOW
=
'
onShow
'
;
const
ON_HIDE
=
'
onHide
'
;
//App
const
ON_LAUNCH
=
'
onLaunch
'
;
const
ON_ERROR
=
'
onError
'
;
const
ON_THEME_CHANGE
=
'
onThemeChange
'
;
const
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
PAGE_HOOKS
=
[
'
onLoad
'
,
'
onShow
'
,
// 'onReady', // lifetimes.ready
'
onHide
'
,
'
onUnload
'
,
'
onResize
'
,
// 'onPageScroll', // 影响性能,开发者手动注册
'
onTabItemTap
'
,
'
onReachBottom
'
,
'
onPullDownRefresh
'
,
// 'onShareTimeline', // 右上角菜单,开发者手动注册
'
onAddToFavorites
'
,
ON_LOAD
,
ON_SHOW
,
ON_HIDE
,
ON_UNLOAD
,
ON_RESIZE
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_ADD_TO_FAVORITES
,
];
function
findHooks
(
vueOptions
,
hooks
=
new
Set
())
{
if
(
vueOptions
)
{
...
...
@@ -156,7 +192,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
'
onReady
'
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -165,12 +201,12 @@ function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
}
const
HOOKS
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onUnhandledRejection
'
,
ON_SHOW
,
ON_HIDE
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
...
...
@@ -189,7 +225,7 @@ function parseApp(instance, parseAppOptions) {
slots
:
[],
});
ctx
.
globalData
=
this
.
globalData
;
instance
.
$callHook
(
'
onLaunch
'
,
options
);
instance
.
$callHook
(
ON_LAUNCH
,
options
);
},
};
const
vueOptions
=
instance
.
$
.
type
;
...
...
@@ -210,26 +246,6 @@ function initCreateApp(parseAppOptions) {
};
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
}
...
...
@@ -793,7 +809,7 @@ function parsePage(vueOptions, parseOptions) {
this
.
$page
=
{
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
};
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
'
onLoad
'
,
query
);
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
};
initHooks
(
methods
,
PAGE_HOOKS
);
initUnknownHooks
(
methods
,
vueOptions
);
...
...
@@ -833,7 +849,7 @@ function initHook(name, options) {
}
}
Page
=
function
(
options
)
{
initHook
(
'
onLoad
'
,
options
);
initHook
(
ON_LOAD
,
options
);
return
MPPage
(
options
);
};
Component
=
function
(
options
)
{
...
...
@@ -1010,7 +1026,7 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
}
vm
.
$callSyncHook
(
'
created
'
);
vm
.
$callHook
(
'
mounted
'
);
vm
.
$callHook
(
'
onReady
'
);
vm
.
$callHook
(
ON_READY
);
}
function
parse
(
componentOptions
,
{
handleLink
})
{
componentOptions
.
methods
.
__l
=
handleLink
;
...
...
@@ -1033,7 +1049,7 @@ function initLifetimes(lifetimesOptions) {
if
(
this
.
$vm
&&
lifetimesOptions
.
isPage
(
this
))
{
this
.
$vm
.
$callSyncHook
(
'
created
'
);
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
'
onReady
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
}
else
{
this
.
is
&&
console
.
warn
(
this
.
is
+
'
is not ready
'
);
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
0 → 100644
浏览文件 @
2027fe7f
此差异已折叠。
点击以展开。
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
...
...
@@ -113,19 +113,55 @@ function initMocks(instance, mpInstance, mocks) {
});
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
// lifecycle
// App and Page
const
ON_SHOW
=
'
onShow
'
;
const
ON_HIDE
=
'
onHide
'
;
//App
const
ON_LAUNCH
=
'
onLaunch
'
;
const
ON_ERROR
=
'
onError
'
;
const
ON_THEME_CHANGE
=
'
onThemeChange
'
;
const
ON_PAGE_NOT_FOUND
=
'
onPageNotFound
'
;
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
const
ON_PULL_DOWN_REFRESH
=
'
onPullDownRefresh
'
;
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
PAGE_HOOKS
=
[
'
onLoad
'
,
'
onShow
'
,
// 'onReady', // lifetimes.ready
'
onHide
'
,
'
onUnload
'
,
'
onResize
'
,
// 'onPageScroll', // 影响性能,开发者手动注册
'
onTabItemTap
'
,
'
onReachBottom
'
,
'
onPullDownRefresh
'
,
// 'onShareTimeline', // 右上角菜单,开发者手动注册
'
onAddToFavorites
'
,
ON_LOAD
,
ON_SHOW
,
ON_HIDE
,
ON_UNLOAD
,
ON_RESIZE
,
ON_TAB_ITEM_TAP
,
ON_REACH_BOTTOM
,
ON_PULL_DOWN_REFRESH
,
ON_ADD_TO_FAVORITES
,
];
function
findHooks
(
vueOptions
,
hooks
=
new
Set
())
{
if
(
vueOptions
)
{
...
...
@@ -153,7 +189,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
'
onReady
'
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -162,12 +198,12 @@ function initUnknownHooks(mpOptions, vueOptions, excludes = EXCLUDE_HOOKS) {
}
const
HOOKS
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onUnhandledRejection
'
,
ON_SHOW
,
ON_HIDE
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
];
function
parseApp
(
instance
,
parseAppOptions
)
{
const
internalInstance
=
instance
.
$
;
...
...
@@ -186,7 +222,7 @@ function parseApp(instance, parseAppOptions) {
slots
:
[],
});
ctx
.
globalData
=
this
.
globalData
;
instance
.
$callHook
(
'
onLaunch
'
,
options
);
instance
.
$callHook
(
ON_LAUNCH
,
options
);
},
};
const
vueOptions
=
instance
.
$
.
type
;
...
...
@@ -207,26 +243,6 @@ function initCreateApp(parseAppOptions) {
};
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
?
Object
.
keys
(
obj
)
.
map
((
key
)
=>
{
let
val
=
obj
[
key
];
if
(
typeof
val
===
undefined
||
val
===
null
)
{
val
=
''
;
}
else
if
(
isPlainObject
(
val
))
{
val
=
JSON
.
stringify
(
val
);
}
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
);
})
.
filter
((
x
)
=>
x
.
length
>
0
)
.
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
;
}
function
initBehavior
(
options
)
{
return
Behavior
(
options
);
}
...
...
@@ -784,7 +800,7 @@ function parsePage(vueOptions, parseOptions) {
this
.
$page
=
{
fullPath
:
'
/
'
+
this
.
route
+
stringifyQuery
(
query
),
};
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
'
onLoad
'
,
query
);
return
this
.
$vm
&&
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
};
initHooks
(
methods
,
PAGE_HOOKS
);
initUnknownHooks
(
methods
,
vueOptions
);
...
...
@@ -824,7 +840,7 @@ function initHook(name, options) {
}
}
Page
=
function
(
options
)
{
initHook
(
'
onLoad
'
,
options
);
initHook
(
ON_LOAD
,
options
);
return
MPPage
(
options
);
};
Component
=
function
(
options
)
{
...
...
@@ -864,7 +880,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
// https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
if
(
this
.
$vm
)
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
'
onReady
'
);
this
.
$vm
.
$callHook
(
ON_READY
);
}
},
detached
()
{
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
2027fe7f
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录