Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
23dc9bdc
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
23dc9bdc
编写于
5月 20, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: patch stopImmediatePropagation
上级
81e9dd76
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
415 addition
and
331 deletion
+415
-331
packages/uni-core/src/view/plugin/componentInstance.ts
packages/uni-core/src/view/plugin/componentInstance.ts
+4
-0
packages/uni-h5-vue/dist/vue.runtime.cjs.js
packages/uni-h5-vue/dist/vue.runtime.cjs.js
+10
-5
packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js
packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js
+10
-5
packages/uni-h5-vue/dist/vue.runtime.compat.esm.js
packages/uni-h5-vue/dist/vue.runtime.compat.esm.js
+10
-5
packages/uni-h5-vue/dist/vue.runtime.esm.js
packages/uni-h5-vue/dist/vue.runtime.esm.js
+10
-5
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+156
-129
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+215
-182
未找到文件。
packages/uni-core/src/view/plugin/componentInstance.ts
浏览文件 @
23dc9bdc
...
...
@@ -49,6 +49,10 @@ export function createNativeEvent(evt: Event | TouchEvent) {
detail
:
{},
currentTarget
:
normalizeTarget
(
currentTarget
as
HTMLElement
),
}
// merge stopImmediatePropagation
if
((
evt
as
any
).
_stopped
)
{
;(
event
as
any
).
_stopped
=
true
}
if
(
evt
.
type
.
startsWith
(
'
touch
'
))
{
;(
event
as
any
).
touches
=
(
evt
as
TouchEvent
).
touches
;(
event
as
any
).
changedTouches
=
(
evt
as
TouchEvent
).
changedTouches
...
...
packages/uni-h5-vue/dist/vue.runtime.cjs.js
浏览文件 @
23dc9bdc
...
...
@@ -8759,17 +8759,18 @@ function createInvoker(initialValue, instance) {
// fixed by xxxxxx
const
proxy
=
instance
&&
instance
.
proxy
;
const
normalizeNativeEvent
=
proxy
&&
proxy
.
$nne
;
if
(
normalizeNativeEvent
&&
shared
.
isArray
(
invoker
.
value
))
{
const
fns
=
invoker
.
value
;
const
{
value
}
=
invoker
;
if
(
normalizeNativeEvent
&&
shared
.
isArray
(
value
))
{
const
fns
=
patchStopImmediatePropagation
(
e
,
value
);
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
const
fn
=
fns
[
i
];
callWithAsyncErrorHandling
(
fn
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
!
fn
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
}
return
;
}
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
// fixed by xxxxxx
normalizeNativeEvent
&&
!
invoker
.
value
.
__wwe
normalizeNativeEvent
&&
!
value
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
...
...
@@ -8786,7 +8787,11 @@ function patchStopImmediatePropagation(e, value) {
originalStop
.
call
(
e
);
e
.
_stopped
=
true
;
};
return
value
.
map
(
fn
=>
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
));
return
value
.
map
(
fn
=>
{
const
patchedFn
=
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
);
patchedFn
.
__wwe
=
fn
.
__wwe
;
return
patchedFn
;
});
}
else
{
return
value
;
...
...
packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js
浏览文件 @
23dc9bdc
...
...
@@ -10678,17 +10678,18 @@ function createInvoker(initialValue, instance) {
// fixed by xxxxxx
const
proxy
=
instance
&&
instance
.
proxy
;
const
normalizeNativeEvent
=
proxy
&&
proxy
.
$nne
;
if
(
normalizeNativeEvent
&&
isArray
(
invoker
.
value
))
{
const
fns
=
invoker
.
value
;
const
{
value
}
=
invoker
;
if
(
normalizeNativeEvent
&&
isArray
(
value
))
{
const
fns
=
patchStopImmediatePropagation
(
e
,
value
);
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
const
fn
=
fns
[
i
];
callWithAsyncErrorHandling
(
fn
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
!
fn
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
}
return
;
}
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
// fixed by xxxxxx
normalizeNativeEvent
&&
!
invoker
.
value
.
__wwe
normalizeNativeEvent
&&
!
value
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
...
...
@@ -10705,7 +10706,11 @@ function patchStopImmediatePropagation(e, value) {
originalStop
.
call
(
e
);
e
.
_stopped
=
true
;
};
return
value
.
map
(
fn
=>
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
));
return
value
.
map
(
fn
=>
{
const
patchedFn
=
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
);
patchedFn
.
__wwe
=
fn
.
__wwe
;
return
patchedFn
;
});
}
else
{
return
value
;
...
...
packages/uni-h5-vue/dist/vue.runtime.compat.esm.js
浏览文件 @
23dc9bdc
...
...
@@ -10732,17 +10732,18 @@ function createInvoker(initialValue, instance) {
// fixed by xxxxxx
const
proxy
=
instance
&&
instance
.
proxy
;
const
normalizeNativeEvent
=
proxy
&&
proxy
.
$nne
;
if
(
normalizeNativeEvent
&&
isArray
(
invoker
.
value
))
{
const
fns
=
invoker
.
value
;
const
{
value
}
=
invoker
;
if
(
normalizeNativeEvent
&&
isArray
(
value
))
{
const
fns
=
patchStopImmediatePropagation
(
e
,
value
);
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
const
fn
=
fns
[
i
];
callWithAsyncErrorHandling
(
fn
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
!
fn
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
}
return
;
}
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
// fixed by xxxxxx
normalizeNativeEvent
&&
!
invoker
.
value
.
__wwe
normalizeNativeEvent
&&
!
value
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
...
...
@@ -10759,7 +10760,11 @@ function patchStopImmediatePropagation(e, value) {
originalStop
.
call
(
e
);
e
.
_stopped
=
true
;
};
return
value
.
map
(
fn
=>
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
));
return
value
.
map
(
fn
=>
{
const
patchedFn
=
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
);
patchedFn
.
__wwe
=
fn
.
__wwe
;
return
patchedFn
;
});
}
else
{
return
value
;
...
...
packages/uni-h5-vue/dist/vue.runtime.esm.js
浏览文件 @
23dc9bdc
...
...
@@ -8807,17 +8807,18 @@ function createInvoker(initialValue, instance) {
// fixed by xxxxxx
const
proxy
=
instance
&&
instance
.
proxy
;
const
normalizeNativeEvent
=
proxy
&&
proxy
.
$nne
;
if
(
normalizeNativeEvent
&&
isArray
(
invoker
.
value
))
{
const
fns
=
invoker
.
value
;
const
{
value
}
=
invoker
;
if
(
normalizeNativeEvent
&&
isArray
(
value
))
{
const
fns
=
patchStopImmediatePropagation
(
e
,
value
);
for
(
let
i
=
0
;
i
<
fns
.
length
;
i
++
)
{
const
fn
=
fns
[
i
];
callWithAsyncErrorHandling
(
fn
,
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
!
fn
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
}
return
;
}
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
invoker
.
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
callWithAsyncErrorHandling
(
patchStopImmediatePropagation
(
e
,
value
),
instance
,
5
/* NATIVE_EVENT_HANDLER */
,
[
// fixed by xxxxxx
normalizeNativeEvent
&&
!
invoker
.
value
.
__wwe
normalizeNativeEvent
&&
!
value
.
__wwe
?
normalizeNativeEvent
(
e
)
:
e
]);
...
...
@@ -8834,7 +8835,11 @@ function patchStopImmediatePropagation(e, value) {
originalStop
.
call
(
e
);
e
.
_stopped
=
true
;
};
return
value
.
map
(
fn
=>
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
));
return
value
.
map
(
fn
=>
{
const
patchedFn
=
(
e
)
=>
!
e
.
_stopped
&&
fn
(
e
);
patchedFn
.
__wwe
=
fn
.
__wwe
;
return
patchedFn
;
});
}
else
{
return
value
;
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
23dc9bdc
...
...
@@ -297,6 +297,9 @@ function createNativeEvent(evt) {
detail
:
{},
currentTarget
:
uniShared
.
normalizeTarget
(
currentTarget
)
};
if
(
evt
.
_stopped
)
{
event
.
_stopped
=
true
;
}
if
(
evt
.
type
.
startsWith
(
"
touch
"
))
{
event
.
touches
=
evt
.
touches
;
event
.
changedTouches
=
evt
.
changedTouches
;
...
...
@@ -1168,7 +1171,121 @@ function provideForm(emit2) {
});
return
fields2
;
}
function
withWebEvent
(
fn
)
{
return
fn
.
__wwe
=
true
,
fn
;
}
function
useCustomEvent
(
ref
,
emit2
)
{
return
(
name
,
evt
,
detail
)
=>
{
if
(
ref
.
value
)
{
emit2
(
name
,
normalizeCustomEvent
(
name
,
evt
,
ref
.
value
,
detail
||
{}));
}
};
}
function
useNativeEvent
(
emit2
)
{
return
(
name
,
evt
)
=>
{
emit2
(
name
,
createNativeEvent
(
evt
));
};
}
function
normalizeCustomEvent
(
name
,
domEvt
,
el
,
detail
)
{
const
target
=
uniShared
.
normalizeTarget
(
el
);
return
{
type
:
detail
.
type
||
name
,
timeStamp
:
domEvt
.
timeStamp
||
0
,
target
,
currentTarget
:
target
,
detail
};
}
const
uniLabelKey
=
PolySymbol
(
process
.
env
.
NODE_ENV
!==
"
production
"
?
"
uniLabel
"
:
"
ul
"
);
const
props$p
=
{
for
:
{
type
:
String
,
default
:
""
}
};
var
index$q
=
/* @__PURE__ */
defineBuiltInComponent
({
name
:
"
Label
"
,
props
:
props$p
,
setup
(
props2
,
{
slots
})
{
const
pageId
=
useCurrentPageId
();
const
handlers
=
useProvideLabel
();
const
pointer
=
vue
.
computed
(()
=>
props2
.
for
||
slots
.
default
&&
slots
.
default
.
length
);
const
_onClick
=
withWebEvent
((
$event
)
=>
{
const
EventTarget
=
$event
.
target
;
let
stopPropagation
=
/^uni-
(
checkbox|radio|switch
)
-/
.
test
(
EventTarget
.
className
);
if
(
!
stopPropagation
)
{
stopPropagation
=
/^uni-
(
checkbox|radio|switch|button
)
$|^
(
svg|path
)
$/i
.
test
(
EventTarget
.
tagName
);
}
if
(
stopPropagation
)
{
return
;
}
if
(
props2
.
for
)
{
UniViewJSBridge
.
emit
(
"
uni-label-click-
"
+
pageId
+
"
-
"
+
props2
.
for
,
$event
,
true
);
}
else
{
handlers
[
0
](
$event
,
true
);
}
});
return
()
=>
vue
.
createVNode
(
"
uni-label
"
,
{
"
class
"
:
{
"
uni-label-pointer
"
:
pointer
},
"
onClick
"
:
_onClick
},
[
slots
.
default
&&
slots
.
default
()],
10
,
[
"
onClick
"
]);
}
});
function
useProvideLabel
()
{
const
handlers
=
[];
vue
.
provide
(
uniLabelKey
,
{
addHandler
(
handler
)
{
handlers
.
push
(
handler
);
},
removeHandler
(
handler
)
{
handlers
.
splice
(
handlers
.
indexOf
(
handler
),
1
);
}
});
return
handlers
;
}
function
entries
(
obj
)
{
return
Object
.
keys
(
obj
).
map
((
key
)
=>
[
key
,
obj
[
key
]]);
}
const
DEFAULT_EXCLUDE_KEYS
=
[
"
class
"
,
"
style
"
];
const
LISTENER_PREFIX
=
/^on
[
A-Z
]
+/
;
const
useAttrs
=
(
params
=
{})
=>
{
const
{
excludeListeners
=
false
,
excludeKeys
=
[]}
=
params
;
const
instance
=
vue
.
getCurrentInstance
();
const
attrs
=
vue
.
shallowRef
({});
const
listeners
=
vue
.
shallowRef
({});
const
excludeAttrs
=
vue
.
shallowRef
({});
const
allExcludeKeys
=
excludeKeys
.
concat
(
DEFAULT_EXCLUDE_KEYS
);
instance
.
attrs
=
vue
.
reactive
(
instance
.
attrs
);
vue
.
watchEffect
(()
=>
{
const
res
=
entries
(
instance
.
attrs
).
reduce
((
acc
,
[
key
,
val
])
=>
{
if
(
allExcludeKeys
.
includes
(
key
))
{
acc
.
exclude
[
key
]
=
val
;
}
else
if
(
LISTENER_PREFIX
.
test
(
key
))
{
if
(
!
excludeListeners
)
{
acc
.
attrs
[
key
]
=
val
;
}
acc
.
listeners
[
key
]
=
val
;
}
else
{
acc
.
attrs
[
key
]
=
val
;
}
return
acc
;
},
{
exclude
:
{},
attrs
:
{},
listeners
:
{}
});
attrs
.
value
=
res
.
attrs
;
listeners
.
value
=
res
.
listeners
;
excludeAttrs
.
value
=
res
.
exclude
;
});
return
{
$attrs
:
attrs
,
$listeners
:
listeners
,
$excludeAttrs
:
excludeAttrs
};
};
var
index$p
=
/* @__PURE__ */
defineBuiltInComponent
({
inheritAttrs
:
false
,
name
:
"
Button
"
,
props
:
{
id
:
{
...
...
@@ -1205,18 +1322,23 @@ var index$q = /* @__PURE__ */ defineBuiltInComponent({
}
},
setup
(
props2
,
{
slots
slots
,
emit
:
emit2
})
{
const
rootRef
=
vue
.
ref
(
null
);
const
uniForm
=
vue
.
inject
(
uniFormKey
,
false
);
const
{
hovering
,
binding
}
=
useHover
(
props2
);
useI18n
();
function
onClick
()
{
const
onClick
=
(
e2
,
isLabelClick
)
=>
{
if
(
props2
.
disabled
)
{
return
;
}
if
(
isLabelClick
)
{
rootRef
.
value
.
click
();
}
const
formType
=
props2
.
formType
;
if
(
formType
)
{
if
(
!
uniForm
)
{
...
...
@@ -1229,19 +1351,37 @@ var index$q = /* @__PURE__ */ defineBuiltInComponent({
}
return
;
}
};
const
uniLabel
=
vue
.
inject
(
uniLabelKey
,
false
);
if
(
!!
uniLabel
)
{
uniLabel
.
addHandler
(
onClick
);
}
const
{
$listeners
,
$attrs
,
$excludeAttrs
}
=
useAttrs
({
excludeListeners
:
true
});
const
_listeners
=
Object
.
create
(
null
);
let
events
=
[
"
onClick
"
,
"
onTap
"
];
if
(
$listeners
.
value
)
{
Object
.
keys
(
$listeners
.
value
).
forEach
((
e2
)
=>
{
if
(
props2
.
disabled
&&
events
.
includes
(
e2
))
{
return
;
}
_listeners
[
e2
]
=
$listeners
.
value
[
e2
];
});
}
return
()
=>
{
const
hoverClass
=
props2
.
hoverClass
;
const
booleanAttrs
=
useBooleanAttr
(
props2
,
"
disabled
"
);
if
(
hoverClass
&&
hoverClass
!==
"
none
"
)
{
return
vue
.
createVNode
(
"
uni-button
"
,
vue
.
mergeProps
({
"
onClick
"
:
onClick
,
"
class
"
:
hovering
.
value
?
hoverClass
:
""
},
binding
,
booleanAttrs
),
[
slots
.
default
&&
slots
.
default
()],
16
,
[
"
onClick
"
]);
}
const
hasHoverClass
=
hoverClass
&&
hoverClass
!==
"
none
"
;
return
vue
.
createVNode
(
"
uni-button
"
,
vue
.
mergeProps
({
"
onClick
"
:
onClick
},
booleanAttrs
),
[
slots
.
default
&&
slots
.
default
()],
16
,
[
"
onClick
"
]);
"
ref
"
:
rootRef
,
"
onClick
"
:
onClick
,
"
class
"
:
hasHoverClass
&&
hovering
.
value
?
hoverClass
:
""
},
hasHoverClass
&&
binding
,
booleanAttrs
,
_listeners
,
$attrs
.
value
,
$excludeAttrs
.
value
),
[
slots
.
default
&&
slots
.
default
()],
16
,
[
"
onClick
"
]);
};
}
});
...
...
@@ -1298,31 +1438,6 @@ function useResizeSensorReset(rootRef) {
lastElementChild
.
scrollTop
=
1
e5
;
};
}
function
withWebEvent
(
fn
)
{
return
fn
.
__wwe
=
true
,
fn
;
}
function
useCustomEvent
(
ref
,
emit2
)
{
return
(
name
,
evt
,
detail
)
=>
{
if
(
ref
.
value
)
{
emit2
(
name
,
normalizeCustomEvent
(
name
,
evt
,
ref
.
value
,
detail
||
{}));
}
};
}
function
useNativeEvent
(
emit2
)
{
return
(
name
,
evt
)
=>
{
emit2
(
name
,
createNativeEvent
(
evt
));
};
}
function
normalizeCustomEvent
(
name
,
domEvt
,
el
,
detail
)
{
const
target
=
uniShared
.
normalizeTarget
(
el
);
return
{
type
:
detail
.
type
||
name
,
timeStamp
:
domEvt
.
timeStamp
||
0
,
target
,
currentTarget
:
target
,
detail
};
}
const
pixelRatio
=
1
;
function
wrapper
(
canvas
)
{
canvas
.
width
=
canvas
.
offsetWidth
*
pixelRatio
;
...
...
@@ -1868,15 +1983,15 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
}
_sfc_main$7
.
render
=
_sfc_render$7
;
const
uniCheckGroupKey
=
PolySymbol
(
process
.
env
.
NODE_ENV
!==
"
production
"
?
"
uniCheckGroup
"
:
"
ucg
"
);
const
props$
p
=
{
const
props$
o
=
{
name
:
{
type
:
String
,
default
:
""
}
};
var
index$
p
=
/* @__PURE__ */
defineBuiltInComponent
({
var
index$
o
=
/* @__PURE__ */
defineBuiltInComponent
({
name
:
"
CheckboxGroup
"
,
props
:
props$
p
,
props
:
props$
o
,
emits
:
[
"
change
"
],
setup
(
props2
,
{
emit
:
emit2
,
...
...
@@ -1928,57 +2043,6 @@ function useProvideCheckGroup(props2, trigger) {
}
return
getFieldsValue
;
}
const
uniLabelKey
=
PolySymbol
(
process
.
env
.
NODE_ENV
!==
"
production
"
?
"
uniLabel
"
:
"
ul
"
);
const
props$o
=
{
for
:
{
type
:
String
,
default
:
""
}
};
var
index$o
=
/* @__PURE__ */
defineBuiltInComponent
({
name
:
"
Label
"
,
props
:
props$o
,
setup
(
props2
,
{
slots
})
{
const
pageId
=
useCurrentPageId
();
const
handlers
=
useProvideLabel
();
const
pointer
=
vue
.
computed
(()
=>
props2
.
for
||
slots
.
default
&&
slots
.
default
.
length
);
const
_onClick
=
withWebEvent
((
$event
)
=>
{
const
EventTarget
=
$event
.
target
;
let
stopPropagation
=
/^uni-
(
checkbox|radio|switch
)
-/
.
test
(
EventTarget
.
className
);
if
(
!
stopPropagation
)
{
stopPropagation
=
/^uni-
(
checkbox|radio|switch|button
)
$|^
(
svg|path
)
$/i
.
test
(
EventTarget
.
tagName
);
}
if
(
stopPropagation
)
{
return
;
}
if
(
props2
.
for
)
{
UniViewJSBridge
.
emit
(
"
uni-label-click-
"
+
pageId
+
"
-
"
+
props2
.
for
,
$event
,
true
);
}
else
{
handlers
[
0
](
$event
,
true
);
}
});
return
()
=>
vue
.
createVNode
(
"
uni-label
"
,
{
"
class
"
:
{
"
uni-label-pointer
"
:
pointer
},
"
onClick
"
:
_onClick
},
[
slots
.
default
&&
slots
.
default
()],
10
,
[
"
onClick
"
]);
}
});
function
useProvideLabel
()
{
const
handlers
=
[];
vue
.
provide
(
uniLabelKey
,
{
addHandler
(
handler
)
{
handlers
.
push
(
handler
);
},
removeHandler
(
handler
)
{
handlers
.
splice
(
handlers
.
indexOf
(
handler
),
1
);
}
});
return
handlers
;
}
const
props$n
=
{
checked
:
{
type
:
[
Boolean
,
String
],
...
...
@@ -2990,43 +3054,6 @@ var Input = /* @__PURE__ */ defineBuiltInComponent({
};
}
});
function
entries
(
obj
)
{
return
Object
.
keys
(
obj
).
map
((
key
)
=>
[
key
,
obj
[
key
]]);
}
const
DEFAULT_EXCLUDE_KEYS
=
[
"
class
"
,
"
style
"
];
const
LISTENER_PREFIX
=
/^on
[
A-Z
]
+/
;
const
useAttrs
=
(
params
=
{})
=>
{
const
{
excludeListeners
=
false
,
excludeKeys
=
[]}
=
params
;
const
instance
=
vue
.
getCurrentInstance
();
const
attrs
=
vue
.
shallowRef
({});
const
listeners
=
vue
.
shallowRef
({});
const
excludeAttrs
=
vue
.
shallowRef
({});
const
allExcludeKeys
=
excludeKeys
.
concat
(
DEFAULT_EXCLUDE_KEYS
);
instance
.
attrs
=
vue
.
reactive
(
instance
.
attrs
);
vue
.
watchEffect
(()
=>
{
const
res
=
entries
(
instance
.
attrs
).
reduce
((
acc
,
[
key
,
val
])
=>
{
if
(
allExcludeKeys
.
includes
(
key
))
{
acc
.
exclude
[
key
]
=
val
;
}
else
if
(
LISTENER_PREFIX
.
test
(
key
))
{
if
(
!
excludeListeners
)
{
acc
.
attrs
[
key
]
=
val
;
}
acc
.
listeners
[
key
]
=
val
;
}
else
{
acc
.
attrs
[
key
]
=
val
;
}
return
acc
;
},
{
exclude
:
{},
attrs
:
{},
listeners
:
{}
});
attrs
.
value
=
res
.
attrs
;
listeners
.
value
=
res
.
listeners
;
excludeAttrs
.
value
=
res
.
exclude
;
});
return
{
$attrs
:
attrs
,
$listeners
:
listeners
,
$excludeAttrs
:
excludeAttrs
};
};
function
initScrollBounce
()
{
}
function
disableScrollBounce
({
disable
})
{
...
...
@@ -11215,10 +11242,10 @@ var index = /* @__PURE__ */ defineSystemComponent({
exports
.
AsyncErrorComponent
=
index$1
;
exports
.
AsyncLoadingComponent
=
index
;
exports
.
Audio
=
_sfc_main$8
;
exports
.
Button
=
index$
q
;
exports
.
Button
=
index$
p
;
exports
.
Canvas
=
_sfc_main$7
;
exports
.
Checkbox
=
index$n
;
exports
.
CheckboxGroup
=
index$
p
;
exports
.
CheckboxGroup
=
index$
o
;
exports
.
CoverImage
=
_sfc_main$2
;
exports
.
CoverView
=
_sfc_main$3
;
exports
.
Editor
=
index$m
;
...
...
@@ -11227,7 +11254,7 @@ exports.Friction = Friction;
exports
.
Icon
=
index$l
;
exports
.
Image
=
index$k
;
exports
.
Input
=
Input
;
exports
.
Label
=
index$
o
;
exports
.
Label
=
index$
q
;
exports
.
LayoutComponent
=
LayoutComponent
;
exports
.
Map
=
index$3
;
exports
.
MovableArea
=
index$j
;
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
23dc9bdc
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录