提交 8712c871 编写于 作者: Q qiang

fix: 修复部分小程序平台 map 组件事件中无法正确获取 markerId 的问题

上级 6f4602aa
......@@ -291,6 +291,10 @@ function wrapper (event) {
event.detail = {}
}
if (!('markerId' in event.detail) && 'markerId' in event) {
event.detail.markerId = event.markerId
}
if (__PLATFORM__ === 'mp-baidu') { // mp-baidu,checked=>value
if (
isPlainObject(event.detail) &&
......@@ -485,18 +489,18 @@ export function handleEvent (event) {
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent
}
if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx,
processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
))
return
}
if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx,
processEventArgs(
this.$vm,
event,
eventArray[1],
eventArray[2],
isCustom,
methodName
))
return
}
const handler = handlerCtx[methodName]
if (!isFn(handler)) {
......@@ -528,4 +532,4 @@ export function handleEvent (event) {
) {
return ret[0]
}
}
}
import {
isFn,
cached,
camelize
camelize,
hasOwn
} from 'uni-shared'
import {
......@@ -58,6 +59,12 @@ export function initSpecialMethods (mpInstance) {
specialMethods.forEach(method => {
if (isFn(mpInstance.$vm[method])) {
mpInstance[method] = function (event) {
if (!hasOwn(event, 'detail')) {
event.detail = {}
}
if (!('markerId' in event.detail) && 'markerId' in event) {
event.detail.markerId = event.markerId
}
// TODO normalizeEvent
mpInstance.$vm[method](event)
}
......@@ -179,4 +186,4 @@ export const handleLink = (function () {
// 支付宝通过 didMount 来实现,先子后父,故等父 ready 之后,统一初始化
(this._$childVues || (this._$childVues = [])).unshift(detail)
}
})()
})()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册