From 47df8fec8a824831e6f88a1a2dce9500c7b77814 Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 21 Aug 2020 20:00:10 +0800 Subject: [PATCH] build runtime --- packages/uni-app-plus/dist/index.js | 5 ++++- packages/uni-mp-alipay/dist/index.js | 13 +++++++++---- packages/uni-mp-baidu/dist/index.js | 13 +++++++++---- packages/uni-mp-qq/dist/index.js | 13 +++++++++---- packages/uni-mp-toutiao/dist/index.js | 13 +++++++++---- packages/uni-mp-weixin/dist/index.js | 13 +++++++++---- packages/uni-quickapp-webview/dist/index.js | 13 +++++++++---- 7 files changed, 58 insertions(+), 25 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index c1b2db572..2d00f4ede 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 38b1b8da2..2e2d94e5a 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 8717ac122..5ac51b5c8 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 5235c9a37..1880b8c00 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 4b6e2a088..09fa3f20a 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 3c62ba816..d9a6178bd 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 07fb23f8b..5eec8463b 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) { -- GitLab