import { useLoginUserStore } from '@/stores/loginUser' const loginUserStore = useLoginUserStore(); export function useSetTabbar() { /** * 设置tabbar */ const setTabbar = (index) => { let flag = false; switch(index){ case 1: // 巡检 if(loginUserStore.loginUser.menu.some(v => v.link === 'app.inspection.inspectList')){ flag = true; } break; } if(flag){ uni.setTabBarItem({ index, visible: true, }); } } return { setTabbar }; }