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]; }