Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ChenYFan_OHHH
uni-app
提交
80a2b59c
U
uni-app
项目概览
ChenYFan_OHHH
/
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,发现更多精彩内容 >>
提交
80a2b59c
编写于
3月 29, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
dfd146c2
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
207 addition
and
551 deletion
+207
-551
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+3
-1
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+71
-157
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+1
-1
packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts
packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts
+4
-6
packages/uni-mp-core/src/index.ts
packages/uni-mp-core/src/index.ts
+1
-0
packages/uni-mp-core/src/runtime/fixSetData.ts
packages/uni-mp-core/src/runtime/fixSetData.ts
+2
-1
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+50
-113
packages/uni-mp-kuaishou/package.json
packages/uni-mp-kuaishou/package.json
+0
-1
packages/uni-mp-kuaishou/src/runtime/parseComponentOptions.ts
...ages/uni-mp-kuaishou/src/runtime/parseComponentOptions.ts
+2
-4
packages/uni-mp-lark/dist/uni.mp.esm.js
packages/uni-mp-lark/dist/uni.mp.esm.js
+21
-84
packages/uni-mp-lark/package.json
packages/uni-mp-lark/package.json
+0
-1
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+11
-74
packages/uni-mp-qq/package.json
packages/uni-mp-qq/package.json
+0
-1
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+21
-84
packages/uni-mp-toutiao/package.json
packages/uni-mp-toutiao/package.json
+0
-1
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+5
-5
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-2
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+4
-2
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+3
-0
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+2
-0
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+3
-1
pnpm-lock.yaml
pnpm-lock.yaml
+2
-12
未找到文件。
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
...
...
@@ -341,7 +341,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
import
{
isPlainObject
,
camelize
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// lifecycle
// App and Page
const
ON_SHOW$1
=
'
onShow
'
;
//Page
const
ON_LOAD$1
=
'
onLoad
'
;
const
ON_READY$1
=
'
onReady
'
;
const
encode$1
=
encodeURIComponent
;
function
stringifyQuery$1
(
obj
,
encodeStr
=
encode$1
)
{
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
}
`
:
''
;
}
class
EventChannel$1
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
((
name
)
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
);
}
fns
.
forEach
((
opt
)
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
((
opt
)
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
;
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
,
...
cacheArgs
.
shift
()]);
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// lifecycle
...
...
@@ -107,6 +17,8 @@ const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
// 百度特有
const
ON_INIT
=
'
onInit
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
const
ON_REACH_BOTTOM
=
'
onReachBottom
'
;
...
...
@@ -452,7 +364,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
,
[
ON_INIT
,
ON_READY
]);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -946,6 +860,45 @@ function initCreatePage(parseOptions) {
};
}
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
*/
function
fixSetDataStart
(
mpInstance
)
{
const
setData
=
mpInstance
.
setData
;
const
setDataArgs
=
[];
mpInstance
.
setData
=
function
()
{
setDataArgs
.
push
(
arguments
);
};
mpInstance
.
__fixInitData
=
function
()
{
this
.
setData
=
setData
;
const
fn
=
()
=>
{
setDataArgs
.
forEach
((
args
)
=>
{
setData
.
apply
(
this
,
args
);
});
};
if
(
setDataArgs
.
length
)
{
if
(
this
.
groupSetData
)
{
this
.
groupSetData
(
fn
);
}
else
{
fn
();
}
}
};
}
/**
* 恢复真实的 setData 方法
* @param {*} mpInstance
*/
function
fixSetDataEnd
(
mpInstance
)
{
if
(
mpInstance
.
__fixInitData
)
{
mpInstance
.
__fixInitData
();
delete
mpInstance
.
__fixInitData
;
}
}
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
function
initTriggerEvent
(
mpInstance
)
{
...
...
@@ -992,54 +945,15 @@ function parse$2(appOptions) {
if
(
!
this
.
$vm
)
{
this
.
onLaunch
(
args
);
}
this
.
$vm
.
$callHook
(
ON_SHOW
$1
,
args
);
this
.
$vm
.
$callHook
(
ON_SHOW
,
args
);
};
}
var
parseAppOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
parse
:
parse$2
__proto__
:
null
,
parse
:
parse$2
});
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
*/
function
fixSetDataStart
(
mpInstance
)
{
const
setData
=
mpInstance
.
setData
;
const
setDataArgs
=
[];
mpInstance
.
setData
=
function
()
{
setDataArgs
.
push
(
arguments
);
};
mpInstance
.
__fixInitData
=
function
()
{
this
.
setData
=
setData
;
const
fn
=
()
=>
{
setDataArgs
.
forEach
((
args
)
=>
{
setData
.
apply
(
this
,
args
);
});
};
if
(
setDataArgs
.
length
)
{
if
(
this
.
groupSetData
)
{
this
.
groupSetData
(
fn
);
}
else
{
fn
();
}
}
};
}
/**
* 恢复真实的 setData 方法
* @param {*} mpInstance
*/
function
fixSetDataEnd
(
mpInstance
)
{
if
(
mpInstance
.
__fixInitData
)
{
mpInstance
.
__fixInitData
();
delete
mpInstance
.
__fixInitData
;
}
}
// @ts-ignore
function
initLifetimes
({
mocks
,
isPage
,
initRelation
,
vueOptions
,
})
{
return
{
...
...
@@ -1080,7 +994,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
{
nextSetDataTick
(
this
,
()
=>
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
});
}
}
...
...
@@ -1135,7 +1049,7 @@ function parse$1(componentOptions) {
fixSetDataStart
(
this
);
oldAttached
.
call
(
this
);
this
.
pageinstance
.
$vm
=
this
.
$vm
;
this
.
$vm
.
$callHook
(
'
onInit
'
,
query
);
this
.
$vm
.
$callHook
(
ON_INIT
,
query
);
};
lifetimes
.
attached
=
function
attached
()
{
if
(
!
this
.
$vm
)
{
...
...
@@ -1151,8 +1065,8 @@ function parse$1(componentOptions) {
const
pageInstance
=
this
.
pageinstance
;
pageInstance
.
$vm
=
this
.
$vm
;
if
(
hasOwn
(
pageInstance
,
'
_$args
'
))
{
this
.
$vm
.
$callHook
(
ON_LOAD
$1
,
pageInstance
.
_$args
);
this
.
$vm
.
$callHook
(
ON_SHOW
$1
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
pageInstance
.
_$args
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
delete
pageInstance
.
_$args
;
}
}
...
...
@@ -1178,13 +1092,13 @@ function parse$1(componentOptions) {
}
var
parseComponentOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
parse
:
parse$1
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
parse
:
parse$1
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
});
function
parse
(
pageOptions
)
{
...
...
@@ -1193,7 +1107,7 @@ function parse(pageOptions) {
// 纠正百度小程序生命周期methods:onShow在methods:onLoad之前触发的问题
methods
.
onShow
=
function
onShow
()
{
if
(
this
.
$vm
&&
this
.
_$loaded
)
{
this
.
$vm
.
$callHook
(
ON_SHOW
$1
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
}
};
methods
.
onLoad
=
function
onLoad
(
query
)
{
...
...
@@ -1204,10 +1118,10 @@ function parse(pageOptions) {
delete
copyQuery
.
__id__
;
this
.
options
=
copyQuery
;
this
.
pageinstance
.
$page
=
this
.
$page
=
{
fullPath
:
'
/
'
+
this
.
pageinstance
.
route
+
stringifyQuery
$1
(
copyQuery
),
fullPath
:
'
/
'
+
this
.
pageinstance
.
route
+
stringifyQuery
(
copyQuery
),
};
this
.
$vm
.
$callHook
(
ON_LOAD
$1
,
query
);
this
.
$vm
.
$callHook
(
ON_SHOW
$1
);
this
.
$vm
.
$callHook
(
ON_LOAD
,
query
);
this
.
$vm
.
$callHook
(
ON_SHOW
);
}
else
{
this
.
pageinstance
.
_$args
=
query
;
...
...
@@ -1216,20 +1130,20 @@ function parse(pageOptions) {
}
var
parsePageOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
parse
:
parse
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
__proto__
:
null
,
parse
:
parse
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
});
const
createApp
=
initCreateApp
(
parseAppOptions
);
const
createPage
=
initCreatePage
(
parsePageOptions
);
const
createComponent
=
initCreateComponent
(
parseComponentOptions
);
const
createSubpackageApp
=
initCreateSubpackageApp
(
parseAppOptions
);
swan
.
EventChannel
=
EventChannel
$1
;
swan
.
EventChannel
=
EventChannel
;
swan
.
createApp
=
global
.
createApp
=
createApp
;
swan
.
createPage
=
createPage
;
swan
.
createComponent
=
createComponent
;
...
...
packages/uni-mp-baidu/package.json
浏览文件 @
80a2b59c
...
...
@@ -26,10 +26,10 @@
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-compiler"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-weixin"
:
"3.0.0-alpha-3040320220325003"
,
"@vue/compiler-core"
:
"3.2.31"
}
...
...
packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts
浏览文件 @
80a2b59c
...
...
@@ -5,12 +5,10 @@ import {
initMocks
,
handleEvent
,
nextSetDataTick
,
}
from
'
@dcloudio/uni-mp-core
'
import
{
ON_LOAD
,
ON_SHOW
}
from
'
@dcloudio/uni-shared
'
import
{
fixSetDataStart
,
fixSetDataEnd
,
}
from
'
@dcloudio/uni-mp-weixin/src/runtime/fixSetData
'
fixSetDataStart
,
}
from
'
@dcloudio/uni-mp-core
'
import
{
ON_INIT
,
ON_LOAD
,
ON_SHOW
}
from
'
@dcloudio/uni-shared
'
export
{
handleLink
,
initLifetimes
}
from
'
@dcloudio/uni-mp-weixin
'
...
...
@@ -49,7 +47,7 @@ export function parse(componentOptions: MPComponentOptions) {
fixSetDataStart
(
this
as
MPComponentInstance
)
oldAttached
.
call
(
this
)
this
.
pageinstance
.
$vm
=
this
.
$vm
this
.
$vm
.
$callHook
(
'
onInit
'
,
query
)
this
.
$vm
.
$callHook
(
ON_INIT
,
query
)
}
lifetimes
.
attached
=
function
attached
(
this
:
MPComponentInstance
)
{
if
(
!
this
.
$vm
)
{
...
...
packages/uni-mp-core/src/index.ts
浏览文件 @
80a2b59c
...
...
@@ -12,6 +12,7 @@ export { initCreatePage } from './runtime/page'
export
{
initCreateComponent
}
from
'
./runtime/component
'
export
{
initCreatePluginApp
}
from
'
./runtime/plugin
'
export
{
findPropsData
}
from
'
./runtime/componentProps
'
export
{
fixSetDataEnd
,
fixSetDataStart
}
from
'
./runtime/fixSetData
'
export
{
initUni
}
from
'
./api/index
'
export
{
initGetProvider
}
from
'
./api/shims
'
...
...
packages/uni-mp-
weixin
/src/runtime/fixSetData.ts
→
packages/uni-mp-
core
/src/runtime/fixSetData.ts
浏览文件 @
80a2b59c
import
{
MPComponentInstance
}
from
'
@dcloudio/uni-mp-core
'
import
{
MPComponentInstance
}
from
'
./component
'
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
...
...
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
class
EventChannel$1
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
((
name
)
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
);
}
fns
.
forEach
((
opt
)
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
((
opt
)
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
;
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
,
...
cacheArgs
.
shift
()]);
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// lifecycle
...
...
@@ -427,7 +362,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -910,6 +847,45 @@ function initCreatePage(parseOptions) {
};
}
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
*/
function
fixSetDataStart
(
mpInstance
)
{
const
setData
=
mpInstance
.
setData
;
const
setDataArgs
=
[];
mpInstance
.
setData
=
function
()
{
setDataArgs
.
push
(
arguments
);
};
mpInstance
.
__fixInitData
=
function
()
{
this
.
setData
=
setData
;
const
fn
=
()
=>
{
setDataArgs
.
forEach
((
args
)
=>
{
setData
.
apply
(
this
,
args
);
});
};
if
(
setDataArgs
.
length
)
{
if
(
this
.
groupSetData
)
{
this
.
groupSetData
(
fn
);
}
else
{
fn
();
}
}
};
}
/**
* 恢复真实的 setData 方法
* @param {*} mpInstance
*/
function
fixSetDataEnd
(
mpInstance
)
{
if
(
mpInstance
.
__fixInitData
)
{
mpInstance
.
__fixInitData
();
delete
mpInstance
.
__fixInitData
;
}
}
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
function
initTriggerEvent
(
mpInstance
)
{
...
...
@@ -987,7 +963,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
{
nextSetDataTick
(
this
,
()
=>
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
});
}
}
...
...
@@ -1024,12 +1000,12 @@ function handleLink(event) {
}
var
baseParseOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
});
function
parse$1
(
pageOptions
)
{
...
...
@@ -1040,45 +1016,6 @@ var parsePageOptions = extend({}, baseParseOptions, {
parse
:
parse$1
,
});
/**
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
*/
function
fixSetDataStart
(
mpInstance
)
{
const
setData
=
mpInstance
.
setData
;
const
setDataArgs
=
[];
mpInstance
.
setData
=
function
()
{
setDataArgs
.
push
(
arguments
);
};
mpInstance
.
__fixInitData
=
function
()
{
this
.
setData
=
setData
;
const
fn
=
()
=>
{
setDataArgs
.
forEach
((
args
)
=>
{
setData
.
apply
(
this
,
args
);
});
};
if
(
setDataArgs
.
length
)
{
if
(
this
.
groupSetData
)
{
this
.
groupSetData
(
fn
);
}
else
{
fn
();
}
}
};
}
/**
* 恢复真实的 setData 方法
* @param {*} mpInstance
*/
function
fixSetDataEnd
(
mpInstance
)
{
if
(
mpInstance
.
__fixInitData
)
{
mpInstance
.
__fixInitData
();
delete
mpInstance
.
__fixInitData
;
}
}
function
parse
(
componentOptions
)
{
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
;
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
...
...
@@ -1103,7 +1040,7 @@ const createApp = initCreateApp();
const
createPage
=
initCreatePage
(
parsePageOptions
);
const
createComponent
=
initCreateComponent
(
parseComponentOptions
);
const
createSubpackageApp
=
initCreateSubpackageApp
();
ks
.
EventChannel
=
EventChannel
$1
;
ks
.
EventChannel
=
EventChannel
;
ks
.
createApp
=
global
.
createApp
=
createApp
;
ks
.
createPage
=
createPage
;
ks
.
createComponent
=
createComponent
;
...
...
packages/uni-mp-kuaishou/package.json
浏览文件 @
80a2b59c
...
...
@@ -26,7 +26,6 @@
"@dcloudio/uni-mp-compiler"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-weixin"
:
"3.0.0-alpha-3040320220325003"
,
"@vue/compiler-core"
:
"3.2.31"
}
...
...
packages/uni-mp-kuaishou/src/runtime/parseComponentOptions.ts
浏览文件 @
80a2b59c
import
{
extend
}
from
'
@vue/shared
'
import
{
fixSetDataEnd
,
fixSetDataStart
,
handleEvent
,
MPComponentInstance
,
MPComponentOptions
,
}
from
'
@dcloudio/uni-mp-core
'
import
*
as
baseParseOptions
from
'
@dcloudio/uni-mp-weixin/src/runtime/parseOptions
'
import
{
fixSetDataStart
,
fixSetDataEnd
,
}
from
'
@dcloudio/uni-mp-weixin/src/runtime/fixSetData
'
export
function
parse
(
componentOptions
:
MPComponentOptions
)
{
const
oldAttached
=
componentOptions
.
lifetimes
!
.
attached
...
...
packages/uni-mp-lark/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
class
EventChannel$1
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
((
name
)
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
);
}
fns
.
forEach
((
opt
)
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
((
opt
)
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
;
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
,
...
cacheArgs
.
shift
()]);
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// lifecycle
...
...
@@ -426,7 +361,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -1106,7 +1043,7 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
}
nextSetDataTick
(
this
,
()
=>
{
vm
.
$callHook
(
'
mounted
'
);
vm
.
$callHook
(
ON_READY
$1
);
vm
.
$callHook
(
ON_READY
);
});
}
function
parse
(
componentOptions
,
{
handleLink
})
{
...
...
@@ -1114,14 +1051,14 @@ function parse(componentOptions, { handleLink }) {
}
var
parseComponentOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
instances
:
instances
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
instances
:
instances
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
});
function
initLifetimes
(
lifetimesOptions
)
{
...
...
@@ -1134,7 +1071,7 @@ function initLifetimes(lifetimesOptions) {
this
.
$vm
.
$callCreatedHook
();
nextSetDataTick
(
this
,
()
=>
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
});
}
else
{
...
...
@@ -1156,20 +1093,20 @@ function initLifetimes(lifetimesOptions) {
}
var
parsePageOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes
});
const
createApp
=
initCreateApp
();
const
createPage
=
initCreatePage
(
parsePageOptions
);
const
createComponent
=
initCreateComponent
(
parseComponentOptions
);
const
createSubpackageApp
=
initCreateSubpackageApp
();
tt
.
EventChannel
=
EventChannel
$1
;
tt
.
EventChannel
=
EventChannel
;
tt
.
createApp
=
global
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
...
...
packages/uni-mp-lark/package.json
浏览文件 @
80a2b59c
...
...
@@ -27,7 +27,6 @@
"@dcloudio/uni-mp-toutiao"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@vue/compiler-core"
:
"3.2.31"
}
}
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
class
EventChannel$1
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
((
name
)
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
);
}
fns
.
forEach
((
opt
)
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
((
opt
)
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
;
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
,
...
cacheArgs
.
shift
()]);
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// lifecycle
...
...
@@ -423,7 +358,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -950,7 +887,7 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
if
(
this
.
$vm
)
{
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
}
}
},
...
...
@@ -986,12 +923,12 @@ function handleLink(event) {
}
var
parseOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
initLifetimes
:
initLifetimes
});
const
createApp
=
initCreateApp
();
...
...
@@ -1005,7 +942,7 @@ wx.createComponent = createComponent;
wx
.
createPluginApp
=
createPluginApp
;
wx
.
createSubpackageApp
=
createSubpackageApp
;
qq
.
EventChannel
=
EventChannel
$1
;
qq
.
EventChannel
=
EventChannel
;
qq
.
createApp
=
global
.
createApp
=
createApp
;
qq
.
createPage
=
createPage
;
qq
.
createComponent
=
createComponent
;
...
...
packages/uni-mp-qq/package.json
浏览文件 @
80a2b59c
...
...
@@ -30,7 +30,6 @@
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
,
"fs-extra"
:
"^10.0.0"
}
}
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
class
EventChannel$1
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
((
name
)
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
);
}
fns
.
forEach
((
opt
)
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
((
opt
)
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
;
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
,
...
cacheArgs
.
shift
()]);
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
,
});
}
}
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// lifecycle
...
...
@@ -426,7 +361,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -1127,7 +1064,7 @@ function handleLink({ detail: { vuePid, nodeId, webviewId }, }) {
}
nextSetDataTick
(
this
,
()
=>
{
vm
.
$callHook
(
'
mounted
'
);
vm
.
$callHook
(
ON_READY
$1
);
vm
.
$callHook
(
ON_READY
);
});
}
function
parse
(
componentOptions
,
{
handleLink
})
{
...
...
@@ -1135,14 +1072,14 @@ function parse(componentOptions, { handleLink }) {
}
var
parseComponentOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
instances
:
instances
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
instances
:
instances
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
});
function
initLifetimes
(
lifetimesOptions
)
{
...
...
@@ -1155,7 +1092,7 @@ function initLifetimes(lifetimesOptions) {
this
.
$vm
.
$callCreatedHook
();
nextSetDataTick
(
this
,
()
=>
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
});
}
else
{
...
...
@@ -1177,20 +1114,20 @@ function initLifetimes(lifetimesOptions) {
}
var
parsePageOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes
__proto__
:
null
,
mocks
:
mocks
,
isPage
:
isPage
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
parse
:
parse
,
initLifetimes
:
initLifetimes
});
const
createApp
=
initCreateApp
();
const
createPage
=
initCreatePage
(
parsePageOptions
);
const
createComponent
=
initCreateComponent
(
parseComponentOptions
);
const
createSubpackageApp
=
initCreateSubpackageApp
();
tt
.
EventChannel
=
EventChannel
$1
;
tt
.
EventChannel
=
EventChannel
;
tt
.
createApp
=
global
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
...
...
packages/uni-mp-toutiao/package.json
浏览文件 @
80a2b59c
...
...
@@ -26,7 +26,6 @@
"@dcloudio/uni-mp-compiler"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@vue/compiler-core"
:
"3.2.31"
}
}
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
...
...
@@ -15,7 +15,7 @@ const ON_PAGE_NOT_FOUND = 'onPageNotFound';
const
ON_UNHANDLE_REJECTION
=
'
onUnhandledRejection
'
;
//Page
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
$1
=
'
onReady
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_TAB_ITEM_TAP
=
'
onTabItemTap
'
;
...
...
@@ -224,7 +224,7 @@ function initHook$1(mpOptions, hook, excludes) {
};
}
}
const
EXCLUDE_HOOKS
=
[
ON_READY
$1
];
const
EXCLUDE_HOOKS
=
[
ON_READY
];
function
initHooks
(
mpOptions
,
hooks
,
excludes
=
EXCLUDE_HOOKS
)
{
hooks
.
forEach
((
hook
)
=>
initHook$1
(
mpOptions
,
hook
,
excludes
));
}
...
...
@@ -295,7 +295,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -750,8 +752,6 @@ function initCreatePluginApp(parseAppOptions) {
};
}
const
ON_READY
=
'
onReady
'
;
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
function
initTriggerEvent
(
mpInstance
)
{
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
80a2b59c
...
...
@@ -31,7 +31,6 @@
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040320220325003"
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040320220325003"
}
}
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
80a2b59c
...
...
@@ -423,7 +423,9 @@ function parseApp(instance, parseAppOptions) {
initLocale
(
instance
);
const
vueOptions
=
instance
.
$
.
type
;
initHooks
(
appOptions
,
HOOKS
);
initUnknownHooks
(
appOptions
,
vueOptions
);
{
initUnknownHooks
(
appOptions
,
vueOptions
);
}
if
(
__VUE_OPTIONS_API__
)
{
const
methods
=
vueOptions
.
methods
;
methods
&&
extend
(
appOptions
,
methods
);
...
...
@@ -1041,7 +1043,7 @@ function initLifetimes(lifetimesOptions) {
this
.
$vm
.
$callCreatedHook
();
nextSetDataTick
(
this
,
()
=>
{
this
.
$vm
.
$callHook
(
'
mounted
'
);
this
.
$vm
.
$callHook
(
ON_READY
$1
);
this
.
$vm
.
$callHook
(
ON_READY
);
});
}
else
{
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
80a2b59c
...
...
@@ -231,6 +231,8 @@ const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
// 百度特有
const
ON_INIT
=
'
onInit
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_BACK_PRESS
=
'
onBackPress
'
;
const
ON_PAGE_SCROLL
=
'
onPageScroll
'
;
...
...
@@ -1441,6 +1443,7 @@ exports.ON_APP_ENTER_FOREGROUND = ON_APP_ENTER_FOREGROUND;
exports
.
ON_BACK_PRESS
=
ON_BACK_PRESS
;
exports
.
ON_ERROR
=
ON_ERROR
;
exports
.
ON_HIDE
=
ON_HIDE
;
exports
.
ON_INIT
=
ON_INIT
;
exports
.
ON_KEYBOARD_HEIGHT_CHANGE
=
ON_KEYBOARD_HEIGHT_CHANGE
;
exports
.
ON_LAUNCH
=
ON_LAUNCH
;
exports
.
ON_LOAD
=
ON_LOAD
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
80a2b59c
...
...
@@ -441,6 +441,8 @@ export declare const ON_ERROR = "onError";
export
declare
const
ON_HIDE
=
"
onHide
"
;
export
declare
const
ON_INIT
=
"
onInit
"
;
export
declare
const
ON_KEYBOARD_HEIGHT_CHANGE
=
"
onKeyboardHeightChange
"
;
export
declare
const
ON_LAUNCH
=
"
onLaunch
"
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
80a2b59c
...
...
@@ -227,6 +227,8 @@ const ON_UNHANDLE_REJECTION = 'onUnhandledRejection';
const
ON_LOAD
=
'
onLoad
'
;
const
ON_READY
=
'
onReady
'
;
const
ON_UNLOAD
=
'
onUnload
'
;
// 百度特有
const
ON_INIT
=
'
onInit
'
;
const
ON_RESIZE
=
'
onResize
'
;
const
ON_BACK_PRESS
=
'
onBackPress
'
;
const
ON_PAGE_SCROLL
=
'
onPageScroll
'
;
...
...
@@ -1389,4 +1391,4 @@ function getEnvLocale() {
return
(
lang
&&
lang
.
replace
(
/
[
.:
]
.*/
,
''
))
||
'
en
'
;
}
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
E$1
as
Emitter
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
SLOT_DEFAULT_NAME
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDatasetOnce
,
invokeArrayFns
,
invokeCreateVueAppHook
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
isRootImmediateHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
onCreateVueApp
,
once
,
parseEventName
,
parseNVueDataset
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
export
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_ADD_WXS_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_EVENT
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_PAGE_SCROLL
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
ATTR_CHANGE_PREFIX
,
ATTR_CLASS
,
ATTR_INNER_HTML
,
ATTR_STYLE
,
ATTR_TEXT_CONTENT
,
ATTR_V_OWNER_ID
,
ATTR_V_RENDERJS
,
ATTR_V_SHOW
,
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
BUILT_IN_TAG_NAMES
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
E$1
as
Emitter
,
EventChannel
,
EventModifierFlags
,
I18N_JSON_DELIMITERS
,
JSON_PROTOCOL
,
LINEFEED
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
NVUE_BUILT_IN_TAGS
,
NVUE_U_BUILT_IN_TAGS
,
ON_ADD_TO_FAVORITES
,
ON_APP_ENTER_BACKGROUND
,
ON_APP_ENTER_FOREGROUND
,
ON_BACK_PRESS
,
ON_ERROR
,
ON_HIDE
,
ON_
INIT
,
ON_
KEYBOARD_HEIGHT_CHANGE
,
ON_LAUNCH
,
ON_LOAD
,
ON_NAVIGATION_BAR_BUTTON_TAP
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED
,
ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED
,
ON_PAGE_NOT_FOUND
,
ON_PAGE_SCROLL
,
ON_PULL_DOWN_REFRESH
,
ON_REACH_BOTTOM
,
ON_REACH_BOTTOM_DISTANCE
,
ON_READY
,
ON_RESIZE
,
ON_SHARE_APP_MESSAGE
,
ON_SHARE_TIMELINE
,
ON_SHOW
,
ON_TAB_ITEM_TAP
,
ON_THEME_CHANGE
,
ON_UNHANDLE_REJECTION
,
ON_UNLOAD
,
ON_WEB_INVOKE_APP_SERVICE
,
ON_WXS_INVOKE_CALL_METHOD
,
PLUS_RE
,
PRIMARY_COLOR
,
RENDERJS_MODULES
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
SLOT_DEFAULT_NAME
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UNI_STORAGE_LOCALE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniLifecycleHooks
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
WXS_MODULES
,
WXS_PROTOCOL
,
addFont
,
addLeadingSlash
,
cache
,
cacheStringFunction
,
callOptions
,
createIsCustomElement
,
createRpx2Unit
,
createUniEvent
,
customizeEvent
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultNVueRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDatasetOnce
,
invokeArrayFns
,
invokeCreateVueAppHook
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
isRootImmediateHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
onCreateVueApp
,
once
,
parseEventName
,
parseNVueDataset
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
pnpm-lock.yaml
浏览文件 @
80a2b59c
...
...
@@ -491,18 +491,18 @@ importers:
packages/uni-mp-baidu
:
specifiers
:
'
@dcloudio/uni-cli-shared'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-compiler'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@vue/compiler-core'
:
3.2.31
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-compiler'
:
link:../uni-mp-compiler
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@vue/compiler-core'
:
3.2.31
packages/uni-mp-compiler
:
...
...
@@ -542,7 +542,6 @@ importers:
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@vue/compiler-core'
:
3.2.31
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
...
...
@@ -550,7 +549,6 @@ importers:
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@vue/compiler-core'
:
3.2.31
packages/uni-mp-lark
:
...
...
@@ -560,7 +558,6 @@ importers:
'
@dcloudio/uni-mp-toutiao'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@vue/compiler-core'
:
3.2.31
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
...
...
@@ -568,7 +565,6 @@ importers:
'
@dcloudio/uni-mp-toutiao'
:
link:../uni-mp-toutiao
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@vue/compiler-core'
:
3.2.31
packages/uni-mp-qq
:
...
...
@@ -577,7 +573,6 @@ importers:
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@types/fs-extra'
:
^9.0.13
'
@vue/compiler-core'
:
3.2.31
fs-extra
:
^10.0.0
...
...
@@ -585,7 +580,6 @@ importers:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-shared'
:
link:../uni-shared
fs-extra
:
10.0.0
devDependencies
:
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
...
...
@@ -598,14 +592,12 @@ importers:
'
@dcloudio/uni-mp-compiler'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@vue/compiler-core'
:
3.2.31
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-compiler'
:
link:../uni-mp-compiler
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@vue/compiler-core'
:
3.2.31
packages/uni-mp-vite
:
...
...
@@ -648,13 +640,11 @@ importers:
'
@dcloudio/uni-cli-shared'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040320220325003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040320220325003
'
@vue/compiler-core'
:
3.2.31
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-shared'
:
link:../uni-shared
devDependencies
:
'
@vue/compiler-core'
:
3.2.31
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录