提交 0249de45 编写于 作者: fxy060608's avatar fxy060608

fix(mp): mp-alipay map 事件转换

上级 f5dae4e6
......@@ -17,7 +17,8 @@ import {
triggerEvent,
createObserver,
isComponent2,
initChildVues
initChildVues,
initSpecialEvents
} from './util'
function initVm (VueComponent) {
......@@ -118,8 +119,7 @@ export default function parseComponent (vueComponentOptions) {
componentOptions.didUpdate = createObserver(true)
}
if (vueOptions.methods && vueOptions.methods.formReset) {
componentOptions.methods.formReset = vueOptions.methods.formReset
}
initSpecialEvents(componentOptions.methods, vueOptions.methods)
return componentOptions
}
......@@ -13,7 +13,8 @@ import {
handleRef,
handleLink,
initBehavior,
initChildVues
initChildVues,
initSpecialEvents
} from './util'
const hooks = [
......@@ -69,9 +70,7 @@ export default function parsePage (vuePageOptions) {
initHooks(pageOptions, hooks)
if (vueOptions.methods && vueOptions.methods.formReset) {
pageOptions.formReset = vueOptions.methods.formReset
}
initSpecialEvents(pageOptions.methods, vueOptions.methods)
return pageOptions
}
......@@ -42,6 +42,25 @@ export function initRelation (detail) {
this.props.onVueInit(detail)
}
const SPECIAL_EVENTS = [
'formReset',
'markerTap',
'calloutTap',
'controlTap',
'regionChange'
]
export function initSpecialEvents (mpMethods, vueMethods) {
if (!vueMethods) {
return
}
SPECIAL_EVENTS.forEach((name) => {
if (vueMethods[name]) {
mpMethods[name] = vueMethods[name]
}
})
}
export function initChildVues (mpInstance) {
// 此时需保证当前 mpInstance 已经存在 $vm
if (!mpInstance.$vm) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册