From 7e088bb57d8f189a1bd3fd8210cf77092091e9c8 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 13 Nov 2019 20:45:44 +0800 Subject: [PATCH] fix: lint --- .../mp-baidu/runtime/wrapper/page-parser.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/platforms/mp-baidu/runtime/wrapper/page-parser.js b/src/platforms/mp-baidu/runtime/wrapper/page-parser.js index aba2a228d..17bcda323 100644 --- a/src/platforms/mp-baidu/runtime/wrapper/page-parser.js +++ b/src/platforms/mp-baidu/runtime/wrapper/page-parser.js @@ -1,5 +1,5 @@ import { - isPage, + isPage, initRelation } from './util' @@ -23,23 +23,23 @@ export default function parsePage (vuePageOptions) { const pageOptions = parseBasePage(vuePageOptions, { isPage, initRelation - }) - - const newLifecycle = swan.canIUse('lifecycle-2-0') - - // 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题 - if (newLifecycle) { - delete pageOptions.methods.onShow + }) + + const newLifecycle = swan.canIUse('lifecycle-2-0') + + // 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题 + if (newLifecycle) { + delete pageOptions.methods.onShow } pageOptions.methods.onLoad = function onLoad (args) { // 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad - if (this.$vm) { - this.$vm.$mp.query = args - this.$vm.__call_hook('onLoad', args) - this.$vm.__call_hook('onShow') - } else { - this.pageinstance._$args = args + if (this.$vm) { + this.$vm.$mp.query = args + this.$vm.__call_hook('onLoad', args) + this.$vm.__call_hook('onShow') + } else { + this.pageinstance._$args = args } } @@ -49,4 +49,4 @@ export default function parsePage (vuePageOptions) { } return pageOptions -} +} -- GitLab