Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
菜鸟程序猿_c
uni-app
提交
218a68e5
U
uni-app
项目概览
菜鸟程序猿_c
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
218a68e5
编写于
3月 07, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
chore: merge
上级
aa93653c
6d5195f5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
31 addition
and
60 deletion
+31
-60
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+13
-26
packages/uni-mp-vue/lib/vue.runtime.esm.js
packages/uni-mp-vue/lib/vue.runtime.esm.js
+2
-21
packages/uni-mp-vue/src/helpers/vOn.ts
packages/uni-mp-vue/src/helpers/vOn.ts
+15
-12
packages/vite-plugin-uni/package.json
packages/vite-plugin-uni/package.json
+1
-1
未找到文件。
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
218a68e5
...
@@ -1407,28 +1407,11 @@ function queueJob(job) {
...
@@ -1407,28 +1407,11 @@ function queueJob(job) {
queueFlush
();
queueFlush
();
}
}
}
}
// fixed by xxxxxx
let
delayFlushJobs
=
false
;
function
setDelayFlushJobs
(
isDelay
)
{
delayFlushJobs
=
isDelay
;
}
// fixed by xxxxxx
function
sleep
(
ms
)
{
return
()
=>
{
return
new
Promise
(
resolve
=>
setTimeout
(()
=>
resolve
(
void
0
),
ms
));
};
}
function
queueFlush
()
{
function
queueFlush
()
{
if
(
!
isFlushing
&&
!
isFlushPending
)
{
if
(
!
isFlushing
&&
!
isFlushPending
)
{
isFlushPending
=
true
;
isFlushPending
=
true
;
if
(
delayFlushJobs
)
{
// fixed by xxxxxx 延迟执行,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
currentFlushPromise
=
resolvedPromise
.
then
(
sleep
(
0
)).
then
(
flushJobs
);
}
else
{
currentFlushPromise
=
resolvedPromise
.
then
(
flushJobs
);
currentFlushPromise
=
resolvedPromise
.
then
(
flushJobs
);
}
}
}
}
}
function
invalidateJob
(
job
)
{
function
invalidateJob
(
job
)
{
const
i
=
queue
.
indexOf
(
job
);
const
i
=
queue
.
indexOf
(
job
);
...
@@ -1506,8 +1489,6 @@ function flushPostFlushCbs(seen) {
...
@@ -1506,8 +1489,6 @@ function flushPostFlushCbs(seen) {
}
}
const
getId
=
(
job
)
=>
job
.
id
==
null
?
Infinity
:
job
.
id
;
const
getId
=
(
job
)
=>
job
.
id
==
null
?
Infinity
:
job
.
id
;
function
flushJobs
(
seen
)
{
function
flushJobs
(
seen
)
{
// fixed by xxxxxx
delayFlushJobs
=
false
;
isFlushPending
=
false
;
isFlushPending
=
false
;
isFlushing
=
true
;
isFlushing
=
true
;
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
...
@@ -5364,7 +5345,17 @@ function createInvoker(initialValue, instance) {
...
@@ -5364,7 +5345,17 @@ function createInvoker(initialValue, instance) {
if
(
e
.
detail
&&
e
.
detail
.
__args__
)
{
if
(
e
.
detail
&&
e
.
detail
.
__args__
)
{
args
=
e
.
detail
.
__args__
;
args
=
e
.
detail
.
__args__
;
}
}
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
args
);
const
eventValue
=
invoker
.
value
;
const
invoke
=
()
=>
{
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
eventValue
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
args
);
};
// 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
if
(
bubbles
.
includes
(
e
.
type
))
{
setTimeout
(
invoke
);
}
else
{
invoke
();
}
};
};
invoker
.
value
=
initialValue
;
invoker
.
value
=
initialValue
;
return
invoker
;
return
invoker
;
...
@@ -5386,10 +5377,6 @@ const bubbles = [
...
@@ -5386,10 +5377,6 @@ const bubbles = [
];
];
function
patchMPEvent
(
event
)
{
function
patchMPEvent
(
event
)
{
if
(
event
.
type
&&
event
.
target
)
{
if
(
event
.
type
&&
event
.
target
)
{
// 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
if
(
bubbles
.
includes
(
event
.
type
))
{
setDelayFlushJobs
(
true
);
}
event
.
preventDefault
=
NOOP
;
event
.
preventDefault
=
NOOP
;
event
.
stopPropagation
=
NOOP
;
event
.
stopPropagation
=
NOOP
;
event
.
stopImmediatePropagation
=
NOOP
;
event
.
stopImmediatePropagation
=
NOOP
;
...
@@ -5583,4 +5570,4 @@ function createApp(rootComponent, rootProps = null) {
...
@@ -5583,4 +5570,4 @@ function createApp(rootComponent, rootProps = null) {
}
}
const
createSSRApp
=
createApp
;
const
createSSRApp
=
createApp
;
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
c
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createSSRApp
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
d
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
e
,
effect
,
effectScope
,
f
,
findComponentPropsData
,
getCurrentInstance
,
getCurrentScope
,
getExposeProxy
,
guardReactiveProps
,
h
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
n
,
nextTick
,
o
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
p
,
patch
,
provide
,
proxyRefs
,
pruneComponentPropsCache
,
queuePostFlushCb
,
r
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
s
,
setCurrentRenderingInstance
,
set
DelayFlushJobs
,
set
TemplateRef
,
setupDevtoolsPlugin
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
sr
,
stop
,
t
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
w
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
c
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createSSRApp
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
d
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
e
,
effect
,
effectScope
,
f
,
findComponentPropsData
,
getCurrentInstance
,
getCurrentScope
,
getExposeProxy
,
guardReactiveProps
,
h
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
n
,
nextTick
,
o
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
p
,
patch
,
provide
,
proxyRefs
,
pruneComponentPropsCache
,
queuePostFlushCb
,
r
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
s
,
setCurrentRenderingInstance
,
setTemplateRef
,
setupDevtoolsPlugin
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
sr
,
stop
,
t
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
w
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
packages/uni-mp-vue/lib/vue.runtime.esm.js
浏览文件 @
218a68e5
...
@@ -1407,28 +1407,11 @@ function queueJob(job) {
...
@@ -1407,28 +1407,11 @@ function queueJob(job) {
queueFlush
();
queueFlush
();
}
}
}
}
// fixed by xxxxxx
let
delayFlushJobs
=
false
;
function
setDelayFlushJobs
(
isDelay
)
{
delayFlushJobs
=
isDelay
;
}
// fixed by xxxxxx
function
sleep
(
ms
)
{
return
()
=>
{
return
new
Promise
(
resolve
=>
setTimeout
(()
=>
resolve
(
void
0
),
ms
));
};
}
function
queueFlush
()
{
function
queueFlush
()
{
if
(
!
isFlushing
&&
!
isFlushPending
)
{
if
(
!
isFlushing
&&
!
isFlushPending
)
{
isFlushPending
=
true
;
isFlushPending
=
true
;
if
(
delayFlushJobs
)
{
// fixed by xxxxxx 延迟执行,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
currentFlushPromise
=
resolvedPromise
.
then
(
sleep
(
0
)).
then
(
flushJobs
);
}
else
{
currentFlushPromise
=
resolvedPromise
.
then
(
flushJobs
);
currentFlushPromise
=
resolvedPromise
.
then
(
flushJobs
);
}
}
}
}
}
function
invalidateJob
(
job
)
{
function
invalidateJob
(
job
)
{
const
i
=
queue
.
indexOf
(
job
);
const
i
=
queue
.
indexOf
(
job
);
...
@@ -1506,8 +1489,6 @@ function flushPostFlushCbs(seen) {
...
@@ -1506,8 +1489,6 @@ function flushPostFlushCbs(seen) {
}
}
const
getId
=
(
job
)
=>
job
.
id
==
null
?
Infinity
:
job
.
id
;
const
getId
=
(
job
)
=>
job
.
id
==
null
?
Infinity
:
job
.
id
;
function
flushJobs
(
seen
)
{
function
flushJobs
(
seen
)
{
// fixed by xxxxxx
delayFlushJobs
=
false
;
isFlushPending
=
false
;
isFlushPending
=
false
;
isFlushing
=
true
;
isFlushing
=
true
;
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
...
@@ -5117,4 +5098,4 @@ function initCssVarsRender(instance, getter) {
...
@@ -5117,4 +5098,4 @@ function initCssVarsRender(instance, getter) {
function
withModifiers
()
{
}
function
withModifiers
()
{
}
function
createVNode$1
()
{
}
function
createVNode$1
()
{
}
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
getExposeProxy
,
guardReactiveProps
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
patch
,
provide
,
proxyRefs
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
setCurrentRenderingInstance
,
set
DelayFlushJobs
,
set
TemplateRef
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
export
{
EffectScope
,
Fragment
,
ReactiveEffect
,
Text
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createVNode$1
as
createVNode
,
createVueApp
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmits
,
defineExpose
,
defineProps
,
diff
,
effect
,
effectScope
,
getCurrentInstance
,
getCurrentScope
,
getExposeProxy
,
guardReactiveProps
,
inject
,
injectHook
,
invalidateJob
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onScopeDispose
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
patch
,
provide
,
proxyRefs
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
resolveComponent
,
resolveDirective
,
resolveFilter
,
setCurrentRenderingInstance
,
setTemplateRef
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
stop
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
updateProps
,
useAttrs
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
version
,
warn$1
as
warn
,
watch
,
watchEffect
,
watchPostEffect
,
watchSyncEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withModifiers
,
withScopeId
};
packages/uni-mp-vue/src/helpers/vOn.ts
浏览文件 @
218a68e5
...
@@ -12,8 +12,6 @@ import {
...
@@ -12,8 +12,6 @@ import {
ErrorCodes
,
ErrorCodes
,
getCurrentInstance
,
getCurrentInstance
,
}
from
'
vue
'
}
from
'
vue
'
// @ts-expect-error
import
{
setDelayFlushJobs
}
from
'
vue
'
type
EventValue
=
Function
|
Function
[]
type
EventValue
=
Function
|
Function
[]
...
@@ -77,13 +75,22 @@ function createInvoker(
...
@@ -77,13 +75,22 @@ function createInvoker(
if
((
e
as
MPEvent
).
detail
&&
(
e
as
MPEvent
).
detail
.
__args__
)
{
if
((
e
as
MPEvent
).
detail
&&
(
e
as
MPEvent
).
detail
.
__args__
)
{
args
=
(
e
as
MPEvent
).
detail
.
__args__
!
args
=
(
e
as
MPEvent
).
detail
.
__args__
!
}
}
const
eventValue
=
invoker
.
value
const
invoke
=
()
=>
{
callWithAsyncErrorHandling
(
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
v
alue
),
patchStopImmediatePropagation
(
e
,
eventV
alue
),
instance
,
instance
,
ErrorCodes
.
NATIVE_EVENT_HANDLER
,
ErrorCodes
.
NATIVE_EVENT_HANDLER
,
args
args
)
)
}
}
// 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
if
(
bubbles
.
includes
(
e
.
type
))
{
setTimeout
(
invoke
)
}
else
{
invoke
()
}
}
invoker
.
value
=
initialValue
invoker
.
value
=
initialValue
return
invoker
return
invoker
}
}
...
@@ -104,10 +111,6 @@ const bubbles = [
...
@@ -104,10 +111,6 @@ const bubbles = [
]
]
function
patchMPEvent
(
event
:
MPEvent
)
{
function
patchMPEvent
(
event
:
MPEvent
)
{
if
(
event
.
type
&&
event
.
target
)
{
if
(
event
.
type
&&
event
.
target
)
{
// 冒泡事件触发时,启用延迟策略,避免同一批次的事件执行时机不正确,对性能可能有略微影响 https://github.com/dcloudio/uni-app/issues/3228
if
(
bubbles
.
includes
(
event
.
type
))
{
setDelayFlushJobs
(
true
)
}
event
.
preventDefault
=
NOOP
event
.
preventDefault
=
NOOP
event
.
stopPropagation
=
NOOP
event
.
stopPropagation
=
NOOP
event
.
stopImmediatePropagation
=
NOOP
event
.
stopImmediatePropagation
=
NOOP
...
...
packages/vite-plugin-uni/package.json
浏览文件 @
218a68e5
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
"vite"
:
"^2.8.6"
"vite"
:
"^2.8.6"
},
},
"uni-app"
:
{
"uni-app"
:
{
"compilerVersion"
:
"3.
3.12
"
"compilerVersion"
:
"3.
4.0
"
},
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录