提交 b94e89e0 编写于 作者: Q qiang

fix(h5): 修复 app 初始化以前调用 uni.getSystemInfoSync 报错的问题 question/116612

上级 f1590070
......@@ -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) { // 选项卡仅列出活动的
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册