diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index c1b2db5724fc40c2208ed0653c2080517a5d095e..2d00f4ede1e9bb532a17a9aab68c478c362d9161 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1429,7 +1429,10 @@ function getEventChannel (id) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index 38b1b8da2b3390e4328998cb3c0e5c2f9b7a3be1..2e2d94e5a7a9c9ffa04148cd9af4b0f9245eda4a 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -2186,7 +2188,10 @@ function parseApp (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 8717ac122b339d99c9758bacccca5b68751355cc..5ac51b5c8c93de83494b0e2750fd68f54c3cf5ed 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -1626,7 +1628,10 @@ function parseApp (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index 5235c9a378a1da312d57efc8f32fcc72c7424a38..1880b8c006ac333857ead904e991df65570de1aa 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -1540,7 +1542,10 @@ function parseApp$1 (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 4b6e2a088e35bb65d7852014e492b4c0f022babb..09fa3f20aa6114176713ea8680a6a396f0e643dc 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -1712,7 +1714,10 @@ function parseApp (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 3c62ba816acec5276af2b474595f833c8c5f05bb..d9a6178bdb895f923e57db7379ffa59283dbb5a3 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -1493,7 +1495,10 @@ function parseApp (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) { diff --git a/packages/uni-quickapp-webview/dist/index.js b/packages/uni-quickapp-webview/dist/index.js index 07fb23f8b68ef709dc81c0e582baf114bf8109f9..5eec8463ba9d7610a94aa66e4b58523fac344995 100644 --- a/packages/uni-quickapp-webview/dist/index.js +++ b/packages/uni-quickapp-webview/dist/index.js @@ -430,11 +430,13 @@ const eventChannelStack = []; let id = 0; -function initEventChannel (events) { +function initEventChannel (events, cache = true) { id++; const eventChannel = new EventChannel(id, events); - eventChannels[id] = eventChannel; - eventChannelStack.push(eventChannel); + if (cache) { + eventChannels[id] = eventChannel; + eventChannelStack.push(eventChannel); + } return eventChannel } @@ -1543,7 +1545,10 @@ function parseApp (vm) { function createApp (vm) { Vue.prototype.getOpenerEventChannel = function () { - return this.__eventChannel__ || new EventChannel() + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__ }; const callHook = Vue.prototype.__call_hook; Vue.prototype.__call_hook = function (hook, args) {