Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
ae55af2e
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae55af2e
编写于
1月 20, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
chore: merge
上级
f7b2624e
a7ce5617
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
96 addition
and
73 deletion
+96
-73
packages/uni-cli-shared/src/mp/event.ts
packages/uni-cli-shared/src/mp/event.ts
+5
-0
packages/uni-mp-alipay/dist/uni.compiler.js
packages/uni-mp-alipay/dist/uni.compiler.js
+6
-1
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+8
-7
packages/uni-mp-alipay/src/compiler/event.ts
packages/uni-mp-alipay/src/compiler/event.ts
+3
-2
packages/uni-mp-alipay/src/runtime/util.ts
packages/uni-mp-alipay/src/runtime/util.ts
+4
-10
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+7
-6
packages/uni-mp-core/src/runtime/polyfill.ts
packages/uni-mp-core/src/runtime/polyfill.ts
+2
-9
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+7
-6
packages/uni-mp-lark/dist/uni.mp.esm.js
packages/uni-mp-lark/dist/uni.mp.esm.js
+7
-6
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+7
-6
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+7
-6
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+7
-6
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+7
-6
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+5
-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
+5
-1
packages/uni-shared/src/vue.ts
packages/uni-shared/src/vue.ts
+7
-1
未找到文件。
packages/uni-cli-shared/src/mp/event.ts
浏览文件 @
ae55af2e
import
{
customizeEvent
}
from
'
@dcloudio/uni-shared
'
export
function
formatMiniProgramEvent
(
eventName
:
string
,
{
...
...
@@ -10,6 +11,10 @@ export function formatMiniProgramEvent(
isComponent
?:
boolean
}
)
{
if
(
isComponent
)
{
// 自定义组件的自定义事件需要格式化,因为 triggerEvent 时也会格式化
eventName
=
customizeEvent
(
eventName
)
}
if
(
!
isComponent
&&
eventName
===
'
click
'
)
{
eventName
=
'
tap
'
}
...
...
packages/uni-mp-alipay/dist/uni.compiler.js
浏览文件 @
ae55af2e
...
...
@@ -44,13 +44,18 @@ function addVueRef(node, context) {
props
.
splice
(
props
.
indexOf
(
refProp
),
0
,
uniCliShared
.
createAttributeNode
(
'
ref
'
,
'
__r
'
));
}
const
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
shared
.
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
const
event
=
{
format
(
name
,
{
isCatch
,
isComponent
})
{
if
(
!
isComponent
&&
name
===
'
click
'
)
{
name
=
'
tap
'
;
}
name
=
eventMap
[
name
]
||
name
;
return
`
${
isCatch
?
'
catch
'
:
'
on
'
}${
shared
.
capitalize
(
shared
.
camelize
(
name
))}
`
;
return
`
${
isCatch
?
'
catch
'
:
'
on
'
}${
shared
.
capitalize
(
customizeEvent
(
name
))}
`
;
},
};
const
eventMap
=
{
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
hasOwn
,
isArray
,
capitalize
,
isFunction
,
extend
,
isString
,
camelize
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
hasOwn
,
isArray
,
capitalize
,
isFunction
,
extend
,
isString
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
EMPTY_OBJ
,
isRef
,
setTemplateRef
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
...
...
@@ -25,6 +25,11 @@ const ON_PULL_DOWN_REFRESH = 'onPullDownRefresh';
const
ON_ADD_TO_FAVORITES
=
'
onAddToFavorites
'
;
const
ON_SHARE_APP_MESSAGE
=
'
onShareAppMessage
'
;
const
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -663,10 +668,6 @@ function handleLink$1(event) {
const
isComponent2
=
my
.
canIUse
(
'
component2
'
);
const
mocks
=
[
'
$id
'
];
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initRelation
(
mpInstance
,
detail
)
{
// onVueInit
mpInstance
.
props
.
onVI
(
detail
);
...
...
@@ -771,7 +772,7 @@ function setRef(ref, refValue, refs, setupState) {
}
}
function
triggerEvent
(
type
,
detail
)
{
const
handler
=
this
.
props
[
customize
(
'
on-
'
+
type
)];
const
handler
=
this
.
props
[
customize
Event
(
'
on-
'
+
type
)];
if
(
!
handler
)
{
return
;
}
...
...
@@ -779,7 +780,7 @@ function triggerEvent(type, detail) {
dataset
:
{},
};
handler
({
type
:
customize
(
type
),
type
:
customize
Event
(
type
),
target
,
currentTarget
:
target
,
detail
,
...
...
packages/uni-mp-alipay/src/compiler/event.ts
浏览文件 @
ae55af2e
import
{
camelize
,
capitalize
}
from
'
@vue/shared
'
import
{
capitalize
}
from
'
@vue/shared
'
import
{
customizeEvent
}
from
'
@dcloudio/uni-shared
'
import
{
MiniProgramCompilerOptions
}
from
'
@dcloudio/uni-cli-shared
'
export
const
event
:
MiniProgramCompilerOptions
[
'
event
'
]
=
{
...
...
@@ -7,7 +8,7 @@ export const event: MiniProgramCompilerOptions['event'] = {
name
=
'
tap
'
}
name
=
eventMap
[
name
]
||
name
return
`
${
isCatch
?
'
catch
'
:
'
on
'
}${
capitalize
(
c
amelize
(
name
))}
`
return
`
${
isCatch
?
'
catch
'
:
'
on
'
}${
capitalize
(
c
ustomizeEvent
(
name
))}
`
},
}
...
...
packages/uni-mp-alipay/src/runtime/util.ts
浏览文件 @
ae55af2e
import
{
hasOwn
,
isFunction
,
camelize
,
isString
}
from
'
@vue/shared
'
import
{
hasOwn
,
isFunction
,
isString
}
from
'
@vue/shared
'
import
{
ComponentPublicInstance
,
...
...
@@ -22,7 +22,7 @@ import {
import
{
handleLink
as
handleBaseLink
}
from
'
@dcloudio/uni-mp-weixin
'
import
{
ON_READY
}
from
'
@dcloudio/uni-shared
'
import
{
customizeEvent
,
ON_READY
}
from
'
@dcloudio/uni-shared
'
type
MPPageInstance
=
tinyapp
.
IPageInstance
<
Record
<
string
,
any
>>
export
type
MPComponentInstance
=
tinyapp
.
IComponentInstance
<
...
...
@@ -34,12 +34,6 @@ export const isComponent2 = my.canIUse('component2')
export
const
mocks
=
[
'
$id
'
]
const
customizeRE
=
/:/g
function
customize
(
str
:
string
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
))
}
export
function
initRelation
(
mpInstance
:
MPComponentInstance
,
detail
:
RelationOptions
...
...
@@ -189,7 +183,7 @@ export function triggerEvent(
type
:
string
,
detail
:
object
)
{
const
handler
=
this
.
props
[
customize
(
'
on-
'
+
type
)]
const
handler
=
this
.
props
[
customize
Event
(
'
on-
'
+
type
)]
if
(
!
handler
)
{
return
}
...
...
@@ -199,7 +193,7 @@ export function triggerEvent(
}
handler
({
type
:
customize
(
type
),
type
:
customize
Event
(
type
),
target
,
currentTarget
:
target
,
detail
,
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// lifecycle
...
...
@@ -93,6 +93,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -897,14 +902,10 @@ function initCreatePage(parseOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-mp-core/src/runtime/polyfill.ts
浏览文件 @
ae55af2e
import
{
camelize
}
from
'
@vue/shared
'
import
{
ON_LOAD
}
from
'
@dcloudio/uni-shared
'
import
{
customizeEvent
,
ON_LOAD
}
from
'
@dcloudio/uni-shared
'
import
{
MPComponentInstance
}
from
'
./component
'
import
{
initPropsObserver
}
from
'
./componentOptions
'
import
{
initProps
}
from
'
./componentProps
'
...
...
@@ -7,16 +6,10 @@ import { initProps } from './componentProps'
const
MPPage
=
Page
const
MPComponent
=
Component
const
customizeRE
=
/:/g
function
customize
(
str
:
string
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
))
}
function
initTriggerEvent
(
mpInstance
:
MPComponentInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
])
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
])
}
}
...
...
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -88,6 +88,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -881,14 +886,10 @@ function initCreatePage(parseOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-mp-lark/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -88,6 +88,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -854,14 +859,10 @@ function initCreatePage(parseOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -88,6 +88,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -849,14 +854,10 @@ function initCreatePluginApp(parseAppOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -88,6 +88,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -854,14 +859,10 @@ function initCreatePage(parseOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
// quickapp-webview 不能使用 default 作为插槽名称
...
...
@@ -23,6 +23,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -723,14 +728,10 @@ const ON_READY = 'onReady';
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
ae55af2e
import
{
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
camelize
,
isObject
}
from
'
@vue/shared
'
;
import
{
camelize
,
isPlainObject
,
isArray
,
hasOwn
,
isFunction
,
extend
,
isObject
}
from
'
@vue/shared
'
;
import
{
injectHook
,
ref
,
nextTick
,
findComponentPropsData
,
toRaw
,
updateProps
,
invalidateJob
,
getExposeProxy
,
pruneComponentPropsCache
}
from
'
vue
'
;
const
ON_READY$1
=
'
onReady
'
;
...
...
@@ -88,6 +88,11 @@ 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
,
'
-
'
));
}
const
encode
=
encodeURIComponent
;
function
stringifyQuery
(
obj
,
encodeStr
=
encode
)
{
const
res
=
obj
...
...
@@ -832,14 +837,10 @@ function initCreatePage(parseOptions) {
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
const
customizeRE
=
/:/g
;
function
customize
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
function
initTriggerEvent
(
mpInstance
)
{
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
]);
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
Event
(
event
),
...
args
]);
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
ae55af2e
...
...
@@ -285,6 +285,10 @@ function resolveOwnerEl(instance) {
function
dynamicSlotName
(
name
)
{
return
name
===
'
default
'
?
SLOT_DEFAULT_NAME
:
name
;
}
const
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
shared
.
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
let
lastLogTime
=
0
;
function
formatLog
(
module
,
...
args
)
{
...
...
@@ -1406,6 +1410,7 @@ exports.callOptions = callOptions;
exports
.
createIsCustomElement
=
createIsCustomElement
;
exports
.
createRpx2Unit
=
createRpx2Unit
;
exports
.
createUniEvent
=
createUniEvent
;
exports
.
customizeEvent
=
customizeEvent
;
exports
.
debounce
=
debounce
;
exports
.
decode
=
decode
;
exports
.
decodedQuery
=
decodedQuery
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
ae55af2e
...
...
@@ -122,6 +122,8 @@ export declare function createRpx2Unit(unit: string, unitRatio: number, unitPrec
export
declare
function
createUniEvent
(
evt
:
Record
<
string
,
any
>
):
UniEvent
;
export
declare
function
customizeEvent
(
str
:
string
):
string
;
export
declare
const
DATA_RE
:
RegExp
;
export
declare
function
debounce
(
fn
:
Function
,
delay
:
number
):
{
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
ae55af2e
...
...
@@ -281,6 +281,10 @@ function resolveOwnerEl(instance) {
function
dynamicSlotName
(
name
)
{
return
name
===
'
default
'
?
SLOT_DEFAULT_NAME
:
name
;
}
const
customizeRE
=
/:/g
;
function
customizeEvent
(
str
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
));
}
let
lastLogTime
=
0
;
function
formatLog
(
module
,
...
args
)
{
...
...
@@ -1295,4 +1299,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
,
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
,
NVueTextNode
,
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
,
debounce
,
decode
,
decodedQuery
,
defaultMiniProgramRpx2Unit
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
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
,
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
,
NVueTextNode
,
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
,
defaultRpx2Unit
,
dynamicSlotName
,
forcePatchProp
,
formatAppLog
,
formatDateTime
,
formatH5Log
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
getValueByDataPath
,
initCustomDataset
,
invokeArrayFns
,
isAppNVueNativeTag
,
isAppNativeTag
,
isBuiltInComponent
,
isComponentInternalInstance
,
isComponentTag
,
isH5CustomElement
,
isH5NativeTag
,
isMiniProgramNativeTag
,
isRootHook
,
normalizeDataset
,
normalizeEventType
,
normalizeTarget
,
once
,
parseEventName
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
resolveComponentInstance
,
resolveOwnerEl
,
resolveOwnerVm
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-shared/src/vue.ts
浏览文件 @
ae55af2e
...
...
@@ -3,7 +3,7 @@ import type {
ComponentPublicInstance
,
VNode
,
}
from
'
@vue/runtime-core
'
import
{
hyphenate
}
from
'
@vue/shared
'
import
{
camelize
,
hyphenate
}
from
'
@vue/shared
'
import
{
isBuiltInComponent
}
from
'
./tags
'
import
{
SLOT_DEFAULT_NAME
}
from
'
./constants
'
...
...
@@ -62,3 +62,9 @@ export function resolveOwnerEl(instance: ComponentInternalInstance) {
export
function
dynamicSlotName
(
name
:
string
)
{
return
name
===
'
default
'
?
SLOT_DEFAULT_NAME
:
name
}
const
customizeRE
=
/:/g
export
function
customizeEvent
(
str
:
string
)
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
))
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录