refactor(projects): 添加exportDefaults替换defineProps

This commit is contained in:
Soybean
2021-11-07 01:23:01 +08:00
committed by Soybean
parent 43b832bee0
commit e61ee32a88
42 changed files with 886 additions and 970 deletions

View File

@ -25,7 +25,7 @@ function hasChildren(route: RouteRecordRaw) {
}
/** 获取被缓存的路由 */
export default function getCacheRoutes(routes: RouteRecordRaw[]) {
export function getCacheRoutes(routes: RouteRecordRaw[]) {
const cacheNames: string[] = [];
routes.forEach(route => {
const isCache = isKeepAlive(route);

View File

@ -1,3 +1,3 @@
export { ROUTE_NAME_MAP, setRouterCacheName, getLoginRedirectUrl, setSingleRoute } from './helpers';
export { default as getCacheRoutes } from './cache';
export { default as transformRouteToMenu } from './menus';
export * from './helpers';
export * from './cache';
export * from './menus';

View File

@ -19,7 +19,7 @@ function addPartialProps(menuItem: GlobalMenuOption, icon?: Component, children?
return item;
}
export default function transformRouteToMenu(routes: CustomRoute[]) {
export function transformRouteToMenu(routes: CustomRoute[]) {
const globalMenu: GlobalMenuOption[] = [];
routes.forEach(route => {
const { name, path, meta } = route;