From 9fa1ba609855e74224aa50f2aaa3f9131418ca84 Mon Sep 17 00:00:00 2001 From: Soybean Date: Tue, 7 Nov 2023 22:59:17 +0800 Subject: [PATCH] feat(projects): add default customRoutes map --- packages/vue/src/core/options.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/vue/src/core/options.ts b/packages/vue/src/core/options.ts index ced186b..750e46d 100644 --- a/packages/vue/src/core/options.ts +++ b/packages/vue/src/core/options.ts @@ -25,7 +25,7 @@ export function createPluginOptions(erOptions: ElegantRouterOption, options?: Pa lazyImport: _name => true, constDir: CONST_DIR, customRoutes: { - map: CUSTOM_ROUTES_MAP, + map: {}, names: [] }, layouts: DEFAULT_LAYOUTS, @@ -39,6 +39,11 @@ export function createPluginOptions(erOptions: ElegantRouterOption, options?: Pa ...options }; + opts.customRoutes.map = { + ...CUSTOM_ROUTES_MAP, + ...opts.customRoutes.map + }; + if (!opts.layouts[opts.defaultLayout]) { opts.defaultLayout = Object.keys(opts.layouts)[0]; }