From 6f31dc02c7ad26b51e3a7a8dbc53b47be8313fb9 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 18 Nov 2019 20:33:13 +0800 Subject: [PATCH] npm run build:runtime --- packages/uni-app-plus/dist/index.js | 12 ++++++++++++ packages/uni-mp-alipay/dist/index.js | 12 ++++++++++++ packages/uni-mp-baidu/dist/index.js | 22 +++++++++++++++++----- packages/uni-mp-qq/dist/index.js | 12 ++++++++++++ packages/uni-mp-toutiao/dist/index.js | 12 ++++++++++++ packages/uni-mp-weixin/dist/index.js | 12 ++++++++++++ 6 files changed, 77 insertions(+), 5 deletions(-) diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 0547d3a20..2edd4e894 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1079,6 +1079,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index eaceec186..9cd0319af 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -1471,6 +1471,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 81a9ad480..6b735d4e9 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -1216,6 +1216,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { @@ -1596,12 +1608,12 @@ function parsePage (vuePageOptions) { initRelation }); - const newLifecycle = swan.canIUse('lifecycle-2-0'); - // 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题 - if (newLifecycle) { - delete pageOptions.methods.onShow; - } + pageOptions.methods.onShow = function onShow () { + if (this.$vm && this.$vm.$mp.query) { + this.$vm.__call_hook('onShow'); + } + }; pageOptions.methods.onLoad = function onLoad (args) { // 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index 50e52986b..edfd191af 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -1134,6 +1134,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 03827351f..9f7142b8a 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -1226,6 +1226,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index bfe222be7..107520ea4 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -1074,6 +1074,18 @@ function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent; + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )); + return } const handler = handlerCtx[methodName]; if (!isFn(handler)) { -- GitLab