From b94e89e0c3cf729f0e54846f9293485e6d218319 Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 5 Feb 2021 16:24:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5):=20=E4=BF=AE=E5=A4=8D=20app=20=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E4=BB=A5=E5=89=8D=E8=B0=83=E7=94=A8=20uni.ge?= =?UTF-8?q?tSystemInfoSync=20=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20question/116612?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/service/plugins/app/create-app.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/service/plugins/app/create-app.js b/src/core/service/plugins/app/create-app.js index 15c146075..e31a63ae6 100644 --- a/src/core/service/plugins/app/create-app.js +++ b/src/core/service/plugins/app/create-app.js @@ -18,14 +18,15 @@ export function getCurrentPages (isAll = false, ignoreError = false) { let childrenVm = app.$children[0] if (childrenVm && childrenVm.$children.length) { const tabBarVm = childrenVm.$children.find(vm => vm.$options.name === 'TabBar') - const layoutVm = childrenVm.$children.find(vm => vm.$options.name === 'Layout') - if (layoutVm) { - childrenVm = layoutVm + const layoutVm = childrenVm.$children.find(vm => vm.$options.name === 'Layout') + if (layoutVm) { + childrenVm = layoutVm } childrenVm.$children.forEach(vm => { if (tabBarVm !== vm && vm.$children.length && vm.$children[0].$options.name === 'Page' && vm.$children[0].$slots.page) { // vm.$children[0]=Page->PageBody->RealPage - const pageVm = vm.$children[0].$children.find(vm => vm.$options.name === 'PageBody').$children.find(vm => !!vm.$page) + const pageBody = vm.$children[0].$children.find(vm => vm.$options.name === 'PageBody') + const pageVm = pageBody && pageBody.$children.find(vm => !!vm.$page) if (pageVm) { let isActive = true if (!isAll && tabBarVm && pageVm.$page && pageVm.$page.meta.isTabBar) { // 选项卡仅列出活动的 -- GitLab