diff --git a/src/utils/index.ts b/src/utils/index.ts index fa81413..20a4b17 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,5 @@ import { pages, subPackages } from '@/pages.json' +import { tabbarList } from '@/tabbar/config' import { isMpWeixin } from './platform' export function getLastPage() { @@ -9,6 +10,13 @@ export function getLastPage() { return pages[pages.length - 1] } +export function isCurrentPageTabbar() { + const lastPage = getLastPage() + const currRoute = (lastPage as any).$page + const { fullPath } = currRoute as { fullPath: string } + return tabbarList.some(item => `/${item.path}` === fullPath) +} + /** * 获取当前页面路由的 path 路径和 redirectPath 路径 * path 如 '/pages/login/index'