提交 89b83259 编写于 作者: fxy060608's avatar fxy060608

fix(mp): mp-baidu ios onLoad args

上级 5e0d15df
......@@ -1105,7 +1105,9 @@ function isPage$1 () {
function initRelation$1 (detail) {
this.dispatch('__l', detail);
}
}
const isIOS$1 = swan.getSystemInfoSync().platform === 'ios';
function parseApp (vm) {
return parseBaseApp(vm, {
......@@ -1210,9 +1212,11 @@ function parseComponent (vueOptions) {
// 百度 当组件作为页面时 pageinstancce 不是原来组件的 instance
this.pageinstance.$vm = this.$vm;
this.$vm.$mp.query = this.pageinstance._$args; // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args);
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
if (!isIOS$1) {
this.$vm.$mp.query = this.pageinstance._$args; // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args);
}
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
this.$vm.__call_hook('onShow');
}
};
......@@ -1274,7 +1278,12 @@ function parsePage (vuePageOptions) {
pageOptions.methods.onLoad = function onLoad (args) {
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
this.pageinstance._$args = args;
this.pageinstance._$args = args;
if (isIOS$1) {
this.$vm.$mp.query = this.pageinstance._$args; // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args);
}
};
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
delete pageOptions.methods.onShow;
......
{
"name": "@dcloudio/uni-mp-baidu",
"version": "0.0.839",
"version": "0.0.840",
"description": "uni-app mp-baidu",
"main": "dist/index.js",
"scripts": {
......
import {
isPage,
isPage,
isIOS,
initRelation
} from './util'
......@@ -19,9 +20,11 @@ export default function parseComponent (vueOptions) {
// 百度 当组件作为页面时 pageinstancce 不是原来组件的 instance
this.pageinstance.$vm = this.$vm
this.$vm.$mp.query = this.pageinstance._$args // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args)
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
if (!isIOS) {
this.$vm.$mp.query = this.pageinstance._$args // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args)
}
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
this.$vm.__call_hook('onShow')
}
}
......
import {
isPage,
isPage,
isIOS,
initRelation
} from './util'
......@@ -27,7 +28,12 @@ export default function parsePage (vuePageOptions) {
pageOptions.methods.onLoad = function onLoad (args) {
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
this.pageinstance._$args = args
this.pageinstance._$args = args
if (isIOS) {
this.$vm.$mp.query = this.pageinstance._$args // 兼容 mpvue
this.$vm.__call_hook('onLoad', this.pageinstance._$args)
}
}
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发
delete pageOptions.methods.onShow
......
......@@ -6,4 +6,6 @@ export function isPage () {
export function initRelation (detail) {
this.dispatch('__l', detail)
}
}
export const isIOS = swan.getSystemInfoSync().platform === 'ios'
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册