zhengyiming
2 天以前 f32357c9f9a2c1e62ff8512d6cce65f4e65e7754
apps/cMiniApp/src/hooks/router.ts
@@ -1,12 +1,12 @@
import Taro from '@tarojs/taro';
import { TabBarPageRouter } from '@/constants';
import { TabBarPageRouter, TabBarPageRouterList } from '@/constants';
import { useSystemStore } from '@/stores/modules/system';
export function useSwitchTab() {
  const systemStore = useSystemStore();
  const switchTab = (option: Taro.switchTab.Option) => {
    const index = Object.values(TabBarPageRouter).findIndex((x) => option.url.includes(x));
    const index = TabBarPageRouterList.findIndex((x) => option.url.includes(x));
    console.log('index: ', index);
    systemStore.setTabIndex(index);
    Taro.switchTab(option);