index.ts 391 B

123456789101112131415
  1. import pagesJson from '@/pages.json'
  2. console.log(pagesJson)
  3. /** 判断当前页面是否是tabbar页 */
  4. export const getIsTabbar = () => {
  5. if (!pagesJson.tabBar || !pagesJson.tabBar.list.length) {
  6. return false
  7. }
  8. const pages = getCurrentPages()
  9. const currPath = pages.at(-1).route
  10. console.log(currPath)
  11. return !!pagesJson.tabBar.list.find((e) => e.pagePath === currPath)
  12. }