From 6e1871dc680887b42bc980685900febc36a05690 Mon Sep 17 00:00:00 2001 From: Danny Zhong Date: Sat, 24 Oct 2020 22:47:39 +0800 Subject: [PATCH] fix no triggerEvent() function when invoke this.$emit() in page. --- src/platforms/mp-alipay/runtime/wrapper/page-parser.js | 6 ++++-- src/platforms/mp-alipay/runtime/wrapper/util.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/platforms/mp-alipay/runtime/wrapper/page-parser.js b/src/platforms/mp-alipay/runtime/wrapper/page-parser.js index b8a24cfe54..500bdff6e1 100644 --- a/src/platforms/mp-alipay/runtime/wrapper/page-parser.js +++ b/src/platforms/mp-alipay/runtime/wrapper/page-parser.js @@ -17,6 +17,7 @@ import { handleRef, handleLink, initBehavior, + triggerEvent, initChildVues, initSpecialMethods } from './util' @@ -85,7 +86,8 @@ export default function parsePage (vuePageOptions) { }, __r: handleRef, __e: handleEvent, - __l: handleLink + __l: handleLink, + triggerEvent } initHooks(pageOptions, hooks, vuePageOptions) @@ -99,4 +101,4 @@ export default function parsePage (vuePageOptions) { } return pageOptions -} +} diff --git a/src/platforms/mp-alipay/runtime/wrapper/util.js b/src/platforms/mp-alipay/runtime/wrapper/util.js index f385dd3577..ef741753af 100644 --- a/src/platforms/mp-alipay/runtime/wrapper/util.js +++ b/src/platforms/mp-alipay/runtime/wrapper/util.js @@ -122,7 +122,7 @@ export function handleRef (ref) { } export function triggerEvent (type, detail, options) { - const handler = this.props[customize('on-' + type)] + const handler = this.props && this.props[customize('on-' + type)] if (!handler) { return } -- GitLab