提交 e8e0f55b 编写于 作者: fxy060608's avatar fxy060608

refactor isTabBarPage

上级 5b87df61
export {
isTabBarPage
} from '../bridge'
export function callApiSync (api, args, name, alias) {
const ret = api(args)
if (ret && ret.errMsg) {
......@@ -19,31 +23,6 @@ export function getLastWebview () {
}
}
export function isTabBarPage (path = '') {
if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) {
return false
}
try {
if (!path) {
const pages = getCurrentPages()
if (!pages.length) {
return false
}
const page = pages[pages.length - 1]
if (!page) {
return false
}
return page.$page.meta.isTabBar
}
return __uniRoutes.find(route => route.path === path).meta.isTabBar
} catch (e) {
if (process.env.NODE_ENV !== 'production') {
console.log('getCurrentPages is not ready')
}
}
return false
}
const getRealRoute = (e, t) => {
if (t.indexOf('./') === 0) return getRealRoute(e, t.substr(2), !1)
let n
......
......@@ -37,3 +37,28 @@ export function setStatusBarStyle (statusBarStyle) {
plus.navigator.setStatusBarStyle(statusBarStyle)
}
export function isTabBarPage (path = '') {
if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) {
return false
}
try {
if (!path) {
const pages = getCurrentPages()
if (!pages.length) {
return false
}
const page = pages[pages.length - 1]
if (!page) {
return false
}
return page.$page.meta.isTabBar
}
return __uniRoutes.find(route => route.path === path).meta.isTabBar
} catch (e) {
if (process.env.NODE_ENV !== 'production') {
console.log('getCurrentPages is not ready')
}
}
return false
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册