提交 b78148e2 编写于 作者: Q qiang

fix: 解决部分小程序组件事件返回信息不正确的问题

上级 f4cd7450
......@@ -287,11 +287,12 @@ function wrapper (event) {
event.target = event.target || {}
if (!hasOwn(event, 'detail') || !event.detail) {
if (!hasOwn(event, 'detail')) {
event.detail = {}
}
if (hasOwn(event, 'markerId') && !hasOwn(event.detail, 'markerId')) {
if (hasOwn(event, 'markerId')) {
event.detail = typeof event.detail === 'object' ? event.detail : {}
event.detail.markerId = event.markerId
}
......
......@@ -59,10 +59,8 @@ export function initSpecialMethods (mpInstance) {
specialMethods.forEach(method => {
if (isFn(mpInstance.$vm[method])) {
mpInstance[method] = function (event) {
if (!hasOwn(event, 'detail') || !event.detail) {
event.detail = {}
}
if (hasOwn(event, 'markerId') && !hasOwn(event.detail, 'markerId')) {
if (hasOwn(event, 'markerId')) {
event.detail = typeof event.detail === 'object' ? event.detail : {}
event.detail.markerId = event.markerId
}
// TODO normalizeEvent
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册