From 29d1159c4dbecd41e8e47f2b191e7f3d5a729eae Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 10 Jun 2019 17:21:48 +0800 Subject: [PATCH] feat(h5): add path and query (App.vue onLaunch,onShow) #408 --- src/core/service/plugins/app/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/service/plugins/app/index.js b/src/core/service/plugins/app/index.js index 8596bda3a..08461afb5 100644 --- a/src/core/service/plugins/app/index.js +++ b/src/core/service/plugins/app/index.js @@ -31,10 +31,13 @@ export function createAppMixin (routes, entryRoute) { }, mounted: function appMounted () { // 稍微靠后点,让 App 有机会在 mounted 事件前注册一些全局事件监听,如 UI 显示(showModal) - callAppHook(this, 'onLaunch', { + const args = { + path: this.$route.meta && this.$route.meta.pagePath, + query: this.$route.query, scene: 1001 - }) - callAppHook(this, 'onShow', {}) + } + callAppHook(this, 'onLaunch', args) + callAppHook(this, 'onShow', args) } } } -- GitLab