unibest/src/utils/index.ts

15 lines
391 B
TypeScript
Raw Normal View History

import pagesJson from '@/pages.json'
console.log(pagesJson)
/** 判断当前页面是否是tabbar页 */
export const getIsTabbar = () => {
2024-01-09 09:05:26 +08:00
if (!pagesJson.tabBar || !pagesJson.tabBar.list.length) {
return false
}
const pages = getCurrentPages()
const currPath = pages.at(-1).route
2024-01-09 09:05:26 +08:00
console.log(currPath)
return !!pagesJson.tabBar.list.find((e) => e.pagePath === currPath)
}