diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 5184dcdebd729003ba06cee9858e4bc79611092f..3a7236d7b84c7d2d9e349428d0ebdfa56927378a 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -562,7 +562,7 @@ const hooks$1 = [ 'onNavigationBarSearchInputClicked' ]; -function attached (VueComponent, args) { +function attached (VueComponent) { this.$vm = new VueComponent({ mpType: 'page', @@ -570,10 +570,6 @@ function attached (VueComponent, args) { }); this.$vm.__call_hook('created'); - if (args) { - this.$vm.$mp.query = args; // 又要兼容 mpvue - this.$vm.__call_hook('onLoad', args); // 开发者可能会在 onLoad 时赋值,提前到 mount 之前 - } this.$vm.$mount(); } @@ -618,7 +614,8 @@ function createPage (vueOptions) { }, methods: { // 作为页面时 onLoad (args) { - attached.call(this, VueComponent, args); + this.$vm.$mp.query = args; // 又要兼容 mpvue + this.$vm.__call_hook('onLoad', args); // 开发者可能会在 onLoad 时赋值,提前到 mount 之前 }, __e: handleEvent, __l: handleLink diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json index 3a61508f2008134fbe4e3156093d9d99bb05c311..96a99c15da0b2797aed1f635f31da4148131d11e 100644 --- a/packages/uni-mp-weixin/package.json +++ b/packages/uni-mp-weixin/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-weixin", - "version": "0.0.920", + "version": "0.0.921", "description": "uni-app mp-weixin", "main": "dist/index.js", "scripts": { diff --git a/src/core/runtime/wrapper/create-page.js b/src/core/runtime/wrapper/create-page.js index 9e72c50eea41820480a3abd654153dd4135eadbe..a4f68d3522dfc0c07dbdee58b104e8c7dc8236be 100644 --- a/src/core/runtime/wrapper/create-page.js +++ b/src/core/runtime/wrapper/create-page.js @@ -31,7 +31,7 @@ const hooks = [ 'onNavigationBarSearchInputClicked' ] -function attached (VueComponent, args) { +function attached (VueComponent) { if (__PLATFORM__ === 'mp-baidu') { this.$baiduComponentInstances = Object.create(null) } @@ -42,10 +42,6 @@ function attached (VueComponent, args) { }) this.$vm.__call_hook('created') - if (args) { - this.$vm.$mp.query = args // 又要兼容 mpvue - this.$vm.__call_hook('onLoad', args) // 开发者可能会在 onLoad 时赋值,提前到 mount 之前 - } this.$vm.$mount() } @@ -92,7 +88,8 @@ export function createPage (vueOptions) { }, methods: { // 作为页面时 onLoad (args) { - attached.call(this, VueComponent, args) + this.$vm.$mp.query = args // 又要兼容 mpvue + this.$vm.__call_hook('onLoad', args) // 开发者可能会在 onLoad 时赋值,提前到 mount 之前 }, __e: handleEvent, __l: handleLink