perf: perf loading logic

This commit is contained in:
vben
2020-12-04 21:25:33 +08:00
parent 0c2e72d22a
commit f4621cc664
26 changed files with 167 additions and 218 deletions

View File

@@ -1,8 +1,6 @@
import type { AppRouteModule, AppRouteRecordRaw } from '/@/router/types';
import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router';
import { appStore } from '/@/store/modules/app';
import { tabStore } from '/@/store/modules/tab';
import { getParentLayout, LAYOUT } from '/@/router/constant';
import dynamicImport from './dynamicImport';
import { cloneDeep } from 'lodash-es';
@@ -48,20 +46,6 @@ export function transformObjToRoute<T = AppRouteModule>(routeList: AppRouteModul
return (routeList as unknown) as T[];
}
/**
* Determine whether the tab has been opened
* @param toPath
*/
export function getIsOpenTab(toPath: string) {
const { openKeepAlive, multiTabsSetting: { show } = {} } = appStore.getProjectConfig;
if (show && openKeepAlive) {
const tabList = tabStore.getTabsState;
return tabList.some((tab) => tab.path === toPath);
}
return false;
}
export function getParams(data: any = {}) {
const { params = {} } = data;
let ret = '';