From cf8367fc91152051c8f1913935f4d0937a25f384 Mon Sep 17 00:00:00 2001 From: liuxiaohang <283700113@qq.com> Date: Wed, 11 Nov 2020 11:33:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(mp-wexin):=20getOpenerEventChannel=E7=9A=84?= =?UTF-8?q?tree=20sharking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/runtime/wrapper/create-app.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/runtime/wrapper/create-app.js b/src/core/runtime/wrapper/create-app.js index a7627fd1e0..308c810773 100644 --- a/src/core/runtime/wrapper/create-app.js +++ b/src/core/runtime/wrapper/create-app.js @@ -12,15 +12,14 @@ import { export default function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - switch (__PLATFORM__) { - case 'mp-weixin': - return this.$scope.getOpenerEventChannel() - default : - if (!this.__eventChannel__) { - this.__eventChannel__ = new EventChannel() - } - return this.__eventChannel__ + // 微信小程序使用自身getOpenerEventChannel + if (__PLATFORM__ === 'mp-weixin') { + return this.$scope.getOpenerEventChannel() } + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel() + } + return this.__eventChannel__ } const callHook = Vue.prototype.__call_hook Vue.prototype.__call_hook = function (hook, args) { -- GitLab