diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 0547d3a2053961bc67cd3482c93b16592f125b8b..2edd4e894aea35c4a434d940e58386ab647e5870 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 eaceec18684a0e47b859ec8a4da0723fd94ceeaa..9cd0319afeb9224a7bfa036fdbbe54b8a7f2d518 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 81a9ad4803a26c93054f90cc840b1a8267c7a5db..6b735d4e9828a8d7e5ee1f0d651f7adfe68570fc 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 50e52986beb6f6da659fbcaed8a40af716df3ba1..edfd191af674af3c66cac068387b71d24aa896df 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 03827351fb09c745ecc283ff36cf83630885457d..9f7142b8aa3db1a2210324f00769dab12d8b767e 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 bfe222be78f748dfe6429776a32ce28eb90ab328..107520ea4321ee4a52648011380acc1be0a43870 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)) {