提交 79f0f467 编写于 作者: fxy060608's avatar fxy060608

feat(wxs): support preventDefault,stopPropagation

上级 c1dc176b
......@@ -63,10 +63,17 @@ export default {
const currentTarget = $event.currentTarget
const instance = currentTarget &&
currentTarget.__vue__ &&
currentTarget.__vue__.$getComponentDescriptor(currentTarget.__vue__, false)
$event = processEvent.call(this, $event.type, $event, {}, findUniTarget($event, this.$el) || $event.target,
$event.currentTarget)
$event.instance = instance
currentTarget.__vue__.$getComponentDescriptor(currentTarget.__vue__, false)
const $origEvent = $event
$event = processEvent.call(this, $origEvent.type, $origEvent, {}, findUniTarget($origEvent, this.$el) || $origEvent.target,
$origEvent.currentTarget)
$event.instance = instance
$event.preventDefault = function () {
return $origEvent.preventDefault()
}
$event.stopPropagation = function () {
return $origEvent.stopPropagation()
}
}
return $event
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册