Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
827b1c1d
U
uni-app
项目概览
DCloud
/
uni-app
5 天 前同步成功
通知
815
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
827b1c1d
编写于
4月 22, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(mp): reduce bundle size
上级
ea98576c
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
129 addition
and
1719 deletion
+129
-1719
packages/uni-mp-alipay/build.json
packages/uni-mp-alipay/build.json
+6
-1
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+2
-69
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+2
-134
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+1
-0
packages/uni-mp-baidu/build.json
packages/uni-mp-baidu/build.json
+6
-1
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+2
-69
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+2
-145
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+3
-1
packages/uni-mp-kuaishou/build.json
packages/uni-mp-kuaishou/build.json
+6
-1
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+2
-69
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+2
-143
packages/uni-mp-kuaishou/package.json
packages/uni-mp-kuaishou/package.json
+3
-1
packages/uni-mp-lark/build.json
packages/uni-mp-lark/build.json
+6
-1
packages/uni-mp-lark/dist/uni.api.esm.js
packages/uni-mp-lark/dist/uni.api.esm.js
+2
-69
packages/uni-mp-lark/dist/uni.mp.esm.js
packages/uni-mp-lark/dist/uni.mp.esm.js
+2
-143
packages/uni-mp-lark/package.json
packages/uni-mp-lark/package.json
+3
-1
packages/uni-mp-qq/build.json
packages/uni-mp-qq/build.json
+6
-1
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+2
-69
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+2
-143
packages/uni-mp-qq/package.json
packages/uni-mp-qq/package.json
+2
-0
packages/uni-mp-toutiao/build.json
packages/uni-mp-toutiao/build.json
+6
-1
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+2
-69
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+2
-143
packages/uni-mp-toutiao/package.json
packages/uni-mp-toutiao/package.json
+2
-0
packages/uni-mp-vue/package.json
packages/uni-mp-vue/package.json
+4
-0
packages/uni-mp-weixin/build.json
packages/uni-mp-weixin/build.json
+1
-1
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+2
-69
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+2
-80
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+3
-1
packages/uni-quickapp-webview/build.json
packages/uni-quickapp-webview/build.json
+6
-1
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+2
-69
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+18
-224
pnpm-lock.yaml
pnpm-lock.yaml
+17
-0
未找到文件。
packages/uni-mp-alipay/build.json
浏览文件 @
827b1c1d
...
...
@@ -35,6 +35,11 @@
"__PLATFORM__"
:
"
\"
mp-alipay
\"
"
,
"__PLATFORM_TITLE__"
:
"支付宝小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
my
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
hasOwn
,
isArray
,
capitalize
,
isFunction
,
extend
,
isString
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
customizeEvent
,
addLeadingSlash
,
stringifyQuery
,
ON_BACK_PRESS
}
from
'
@dcloudio/uni-shared
'
;
import
{
hasOwn
,
isArray
,
capitalize
,
isFunction
,
extend
,
isPlainObject
,
isString
}
from
'
@vue/shared
'
;
import
{
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
EMPTY_OBJ
,
isRef
,
setTemplateRef
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-alipay/package.json
浏览文件 @
827b1c1d
...
...
@@ -25,6 +25,7 @@
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
,
"@vue/shared"
:
"3.2.33"
}
...
...
packages/uni-mp-baidu/build.json
浏览文件 @
827b1c1d
...
...
@@ -36,6 +36,11 @@
"__PLATFORM__"
:
"
\"
mp-baidu
\"
"
,
"__PLATFORM_TITLE__"
:
"百度小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
swan
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
ON_INIT
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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_INIT
=
'
onInit
'
;
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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-baidu/package.json
浏览文件 @
827b1c1d
...
...
@@ -31,6 +31,8 @@
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-weixin"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
,
"@vue/shared"
:
"3.2.33"
}
}
packages/uni-mp-kuaishou/build.json
浏览文件 @
827b1c1d
...
...
@@ -36,6 +36,11 @@
"__PLATFORM__"
:
"
\"
mp-kuaishou
\"
"
,
"__PLATFORM_TITLE__"
:
"快手小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-kuaishou/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
ks
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-kuaishou/package.json
浏览文件 @
827b1c1d
...
...
@@ -27,6 +27,8 @@
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-weixin"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
,
"@vue/shared"
:
"3.2.33"
}
}
packages/uni-mp-lark/build.json
浏览文件 @
827b1c1d
...
...
@@ -36,6 +36,11 @@
"__PLATFORM__"
:
"
\"
mp-lark
\"
"
,
"__PLATFORM_TITLE__"
:
"飞书小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-lark/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
tt
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-lark/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
,
isObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-lark/package.json
浏览文件 @
827b1c1d
...
...
@@ -27,6 +27,8 @@
"@dcloudio/uni-mp-toutiao"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/compiler-core"
:
"3.2.33"
,
"@vue/shared"
:
"3.2.33"
}
}
packages/uni-mp-qq/build.json
浏览文件 @
827b1c1d
...
...
@@ -37,6 +37,11 @@
"__PLATFORM__"
:
"
\"
mp-qq
\"
"
,
"__PLATFORM_TITLE__"
:
"QQ小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
qq
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
}
from
'
@vue/shared
'
;
import
{
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-qq/package.json
浏览文件 @
827b1c1d
...
...
@@ -30,6 +30,8 @@
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/shared"
:
"3.2.33"
,
"fs-extra"
:
"^10.0.0"
}
}
packages/uni-mp-toutiao/build.json
浏览文件 @
827b1c1d
...
...
@@ -36,6 +36,11 @@
"__PLATFORM__"
:
"
\"
mp-toutiao
\"
"
,
"__PLATFORM_TITLE__"
:
"字节跳动小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
tt
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
,
isObject
}
from
'
@vue/shared
'
;
import
{
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-toutiao/package.json
浏览文件 @
827b1c1d
...
...
@@ -26,6 +26,8 @@
"@dcloudio/uni-mp-compiler"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/shared"
:
"3.2.33"
,
"@vue/compiler-core"
:
"3.2.33"
}
}
packages/uni-mp-vue/package.json
浏览文件 @
827b1c1d
...
...
@@ -18,6 +18,10 @@
"url"
:
"https://github.com/dcloudio/uni-app/issues"
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"dependencies"
:
{
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/shared"
:
"3.2.33"
},
"devDependencies"
:
{
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
}
...
...
packages/uni-mp-weixin/build.json
浏览文件 @
827b1c1d
...
...
@@ -36,6 +36,6 @@
"__PLATFORM__"
:
"
\"
mp-weixin
\"
"
,
"__PLATFORM_TITLE__"
:
"微信小程序"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@
dcloudio/uni-shared"
,
"@
vue/shared"
,
"vue"
]
}
]
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
function
getBaseSystemInfo
()
{
return
wx
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -547,7 +480,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
}
from
'
@vue/shared
'
;
import
{
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
const
SLOT_DEFAULT_NAME
=
'
d
'
;
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
827b1c1d
...
...
@@ -31,6 +31,8 @@
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vite"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
"@dcloudio/uni-mp-vue"
:
"3.0.0-alpha-3040620220415003"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3040620220415003"
,
"@vue/shared"
:
"3.2.33"
}
}
packages/uni-quickapp-webview/build.json
浏览文件 @
827b1c1d
...
...
@@ -37,6 +37,11 @@
"__PLATFORM__"
:
"
\"
quickapp-webview
\"
"
,
"__PLATFORM_TITLE__"
:
"快应用(Webview)版"
},
"external"
:
[
"@dcloudio/uni-i18n"
,
"@vue/shared"
,
"vue"
]
"external"
:
[
"@dcloudio/uni-i18n"
,
"@dcloudio/uni-shared"
,
"@vue/shared"
,
"vue"
]
}
]
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
827b1c1d
import
{
isArray
,
hasOwn
,
isString
,
isPlainObject
,
isObject
,
capitalize
,
toRawType
,
makeMap
,
isFunction
,
isPromise
,
remove
,
extend
}
from
'
@vue/shared
'
;
let
vueApp
;
const
createVueAppHooks
=
[];
/**
* 提供 createApp 的回调事件,方便三方插件接收 App 对象,处理挂靠全局 mixin 之类的逻辑
*/
function
onCreateVueApp
(
hook
)
{
// TODO 每个 nvue 页面都会触发
if
(
vueApp
)
{
return
hook
(
vueApp
);
}
createVueAppHooks
.
push
(
hook
);
}
function
invokeCreateVueAppHook
(
app
)
{
vueApp
=
app
;
createVueAppHooks
.
forEach
((
hook
)
=>
hook
(
app
));
}
import
{
Emitter
,
onCreateVueApp
,
invokeCreateVueAppHook
}
from
'
@dcloudio/uni-shared
'
;
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -57,57 +41,6 @@ function getBaseSystemInfo() {
return
qa
.
getSystemInfoSync
()
}
const
E
=
function
()
{
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
};
E
.
prototype
=
{
on
:
function
(
name
,
callback
,
ctx
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
(
e
[
name
]
||
(
e
[
name
]
=
[])).
push
({
fn
:
callback
,
ctx
:
ctx
,
});
return
this
;
},
once
:
function
(
name
,
callback
,
ctx
)
{
var
self
=
this
;
function
listener
()
{
self
.
off
(
name
,
listener
);
callback
.
apply
(
ctx
,
arguments
);
}
listener
.
_
=
callback
;
return
this
.
on
(
name
,
listener
,
ctx
);
},
emit
:
function
(
name
)
{
var
data
=
[].
slice
.
call
(
arguments
,
1
);
var
evtArr
=
((
this
.
e
||
(
this
.
e
=
{}))[
name
]
||
[]).
slice
();
var
i
=
0
;
var
len
=
evtArr
.
length
;
for
(
i
;
i
<
len
;
i
++
)
{
evtArr
[
i
].
fn
.
apply
(
evtArr
[
i
].
ctx
,
data
);
}
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
e
=
this
.
e
||
(
this
.
e
=
{});
var
evts
=
e
[
name
];
var
liveEvents
=
[];
if
(
evts
&&
callback
)
{
for
(
var
i
=
0
,
len
=
evts
.
length
;
i
<
len
;
i
++
)
{
if
(
evts
[
i
].
fn
!==
callback
&&
evts
[
i
].
fn
.
_
!==
callback
)
liveEvents
.
push
(
evts
[
i
]);
}
}
// Remove event from queue to prevent memory leak
// Suggested by https://github.com/lazd
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
liveEvents
.
length
?
(
e
[
name
]
=
liveEvents
)
:
delete
e
[
name
];
return
this
;
},
};
var
E$1
=
E
;
function
validateProtocolFail
(
name
,
msg
)
{
console
.
warn
(
`
${
name
}
:
${
msg
}
`
);
}
...
...
@@ -583,7 +516,7 @@ const EmitProtocol = [
},
];
const
emitter
=
new
E
$1
();
const
emitter
=
new
E
mitter
();
const
$on
=
defineSyncApi
(
API_ON
,
(
name
,
callback
)
=>
{
emitter
.
on
(
name
,
callback
);
return
()
=>
emitter
.
off
(
name
,
callback
);
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
827b1c1d
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
SLOT_DEFAULT_NAME
,
EventChannel
,
invokeArrayFns
,
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
,
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
,
ON_READY
,
once
,
ON_LAUNCH
,
ON_ERROR
,
ON_THEME_CHANGE
,
ON_PAGE_NOT_FOUND
,
ON_UNHANDLE_REJECTION
,
addLeadingSlash
,
stringifyQuery
,
customizeEvent
}
from
'
@dcloudio/uni-shared
'
;
import
{
isArray
,
hasOwn
,
isFunction
,
extend
,
isPlainObject
,
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
// 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
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
hasLeadingSlash
(
str
)
{
return
str
.
indexOf
(
'
/
'
)
===
0
;
}
function
addLeadingSlash
(
str
)
{
return
hasLeadingSlash
(
str
)
?
str
:
'
/
'
+
str
;
}
const
invokeArrayFns
=
(
fns
,
arg
)
=>
{
let
ret
;
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
ret
=
fns
[
i
](
arg
);
}
return
ret
;
};
function
once
(
fn
,
ctx
=
null
)
{
let
res
;
return
((...
args
)
=>
{
if
(
fn
)
{
res
=
fn
.
apply
(
ctx
,
args
);
fn
=
null
;
}
return
res
;
});
}
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
}
`
:
''
;
}
class
EventChannel
{
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
,
});
}
}
const
MINI_PROGRAM_PAGE_RUNTIME_HOOKS
=
/*#__PURE__*/
(()
=>
{
return
{
onPageScroll
:
1
,
onShareAppMessage
:
1
<<
1
,
onShareTimeline
:
1
<<
2
,
};
})();
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
...
...
@@ -1126,7 +920,7 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
delete
vm
.
_$childVues
;
}
vm
.
$callHook
(
'
mounted
'
);
vm
.
$callHook
(
ON_READY
$1
);
vm
.
$callHook
(
ON_READY
);
};
// 当 parentVm 已经 mounted 时,直接触发,否则延迟
if
(
!
parentVm
||
parentVm
.
$
.
isMounted
)
{
...
...
@@ -1142,30 +936,30 @@ function handleLink({ detail: { nodeId, webviewId }, }) {
}
var
parseComponentOptions
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
mocks
:
mocks
,
isPage
:
isPage
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
__proto__
:
null
,
initRelation
:
initRelation
,
handleLink
:
handleLink
,
mocks
:
mocks
,
isPage
:
isPage
,
parse
:
parse
,
initLifetimes
:
initLifetimes$1
});
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
();
qa
.
EventChannel
=
EventChannel
$1
;
qa
.
EventChannel
=
EventChannel
;
qa
.
createApp
=
global
.
createApp
=
createApp
;
qa
.
createPage
=
createPage
;
qa
.
createComponent
=
createComponent
;
...
...
pnpm-lock.yaml
浏览文件 @
827b1c1d
...
...
@@ -503,6 +503,7 @@ importers:
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040620220415003
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-compiler'
:
link:../uni-mp-compiler
...
...
@@ -510,6 +511,7 @@ importers:
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
packages/uni-mp-compiler
:
specifiers
:
...
...
@@ -549,6 +551,7 @@ importers:
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040620220415003
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-compiler'
:
link:../uni-mp-compiler
...
...
@@ -556,6 +559,7 @@ importers:
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
packages/uni-mp-lark
:
specifiers
:
...
...
@@ -565,6 +569,7 @@ importers:
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
dependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-mp-compiler'
:
link:../uni-mp-compiler
...
...
@@ -572,6 +577,7 @@ importers:
'
@dcloudio/uni-mp-vite'
:
link:../uni-mp-vite
'
@dcloudio/uni-mp-vue'
:
link:../uni-mp-vue
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
packages/uni-mp-qq
:
specifiers
:
...
...
@@ -581,11 +587,13 @@ importers:
'
@dcloudio/uni-mp-weixin'
:
3.0.0-alpha-3040620220415003
'
@types/fs-extra'
:
^9.0.13
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
fs-extra
:
^10.0.0
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
'
@vue/shared'
:
3.2.33
fs-extra
:
10.0.0
devDependencies
:
'
@dcloudio/uni-mp-weixin'
:
link:../uni-mp-weixin
...
...
@@ -599,12 +607,14 @@ importers:
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
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
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
packages/uni-mp-vite
:
specifiers
:
...
...
@@ -634,6 +644,11 @@ importers:
packages/uni-mp-vue
:
specifiers
:
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3040620220415003
'
@vue/shared'
:
3.2.33
dependencies
:
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@vue/shared'
:
3.2.33
devDependencies
:
'
@dcloudio/uni-mp-vue'
:
'
link:'
...
...
@@ -643,10 +658,12 @@ importers:
'
@dcloudio/uni-mp-vite'
:
3.0.0-alpha-3040620220415003
'
@dcloudio/uni-mp-vue'
:
3.0.0-alpha-3040620220415003
'
@vue/compiler-core'
:
3.2.33
'
@vue/shared'
:
3.2.33
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
'
@vue/shared'
:
3.2.33
devDependencies
:
'
@vue/compiler-core'
:
3.2.33
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录