[improvement] optimize listeners

This commit is contained in:
陈嘉涵
2019-05-05 17:46:55 +08:00
parent 70550a500f
commit 9104e2dc5a
11 changed files with 38 additions and 36 deletions
+6 -4
View File
@@ -18,6 +18,11 @@ export type OverlayEvents = {
const [sfc, bem] = use('overlay');
function preventTouchMove(event: TouchEvent) {
event.preventDefault();
event.stopPropagation();
}
function Overlay(
h: CreateElement,
props: OverlayProps,
@@ -35,10 +40,7 @@ function Overlay(
vShow={props.visible}
style={style}
class={[bem(), props.className]}
onTouchmove={(event: TouchEvent) => {
event.preventDefault();
event.stopPropagation();
}}
onTouchmove={preventTouchMove}
{...inherit(ctx, true)}
/>
</transition>