From 897e189c9a83bda720fcd19c7f86434d55015e0c Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Mon, 18 Nov 2019 12:27:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BE=E5=BA=A6?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=BF=94=E5=9B=9E=E4=B8=8D=E8=A7=A6?= =?UTF-8?q?=E5=8F=91onShow=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/mp-baidu/runtime/wrapper/page-parser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platforms/mp-baidu/runtime/wrapper/page-parser.js b/src/platforms/mp-baidu/runtime/wrapper/page-parser.js index 17bcda323..9e2c463f8 100644 --- a/src/platforms/mp-baidu/runtime/wrapper/page-parser.js +++ b/src/platforms/mp-baidu/runtime/wrapper/page-parser.js @@ -28,8 +28,10 @@ export default function parsePage (vuePageOptions) { 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) { -- GitLab