提交 7e088bb5 编写于 作者: Q qiang

fix: lint

上级 0caf386e
import { import {
isPage, isPage,
initRelation initRelation
} from './util' } from './util'
...@@ -23,23 +23,23 @@ export default function parsePage (vuePageOptions) { ...@@ -23,23 +23,23 @@ export default function parsePage (vuePageOptions) {
const pageOptions = parseBasePage(vuePageOptions, { const pageOptions = parseBasePage(vuePageOptions, {
isPage, isPage,
initRelation initRelation
}) })
const newLifecycle = swan.canIUse('lifecycle-2-0') const newLifecycle = swan.canIUse('lifecycle-2-0')
// 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题 // 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题
if (newLifecycle) { if (newLifecycle) {
delete pageOptions.methods.onShow delete pageOptions.methods.onShow
} }
pageOptions.methods.onLoad = function onLoad (args) { pageOptions.methods.onLoad = function onLoad (args) {
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad // 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
if (this.$vm) { if (this.$vm) {
this.$vm.$mp.query = args this.$vm.$mp.query = args
this.$vm.__call_hook('onLoad', args) this.$vm.__call_hook('onLoad', args)
this.$vm.__call_hook('onShow') this.$vm.__call_hook('onShow')
} else { } else {
this.pageinstance._$args = args this.pageinstance._$args = args
} }
} }
...@@ -49,4 +49,4 @@ export default function parsePage (vuePageOptions) { ...@@ -49,4 +49,4 @@ export default function parsePage (vuePageOptions) {
} }
return pageOptions return pageOptions
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册