diff --git a/src/core/runtime/wrapper/create-app.js b/src/core/runtime/wrapper/create-app.js index a7627fd1e09275a4211c211240eacbcd8fa18e33..308c8107736519f8406a35cd1c6b07de516aa8d6 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) {