将 menu 从 appstore 提出.

This commit is contained in:
lijiahangmax
2023-09-25 22:05:48 +08:00
parent 80e5e241fa
commit 99d6d16a04
23 changed files with 190 additions and 287 deletions

View File

@@ -1,12 +1,12 @@
import { computed } from 'vue';
import { RouteRecordRaw, RouteRecordNormalized } from 'vue-router';
import { useAppStore } from '@/store';
import { useMenuStore } from '@/store';
import { cloneDeep } from 'lodash';
export default function useMenuTree() {
const appStore = useAppStore();
const menuStore = useMenuStore();
const appRoute = computed(() => {
return appStore.appAsyncMenus;
return menuStore.appMenus;
});
const menuTree = computed(() => {
const copyRouter = cloneDeep(appRoute.value) as RouteRecordNormalized[];