提交 ac14b511 编写于 作者: Q qiang

fix: H5端调用uni.getSystemInfoSync在初始化前忽略警告

上级 a32a4b2b
......@@ -6,11 +6,13 @@ export function getApp () {
return appVm
}
export function getCurrentPages (isAll = false) {
export function getCurrentPages (isAll = false, ignoreError = false) {
const pages = []
const app = getApp()
if (!app) {
console.error('app is not ready')
if (ignoreError) {
console.error('app is not ready')
}
return []
}
const childrenVm = app.$children[0]
......@@ -62,4 +64,4 @@ export default function createApp (vm, routes) {
// initEvents(appVm)
initRouterGuard(appVm, routes)
}
}
......@@ -84,7 +84,7 @@ export function getSystemInfoSync () {
const {
top: windowTop,
bottom: windowBottom
} = getWindowOffset()
} = getWindowOffset(false, true)
windowHeight -= windowTop
windowHeight -= windowBottom
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册