Skip to content

Why vmo-router ​

The problem it solves ​

An administration application often receives menu or page definitions after login. Report components live locally, while configuration determines available pages, paths and titles. One component may serve several business pages. The application also needs to restore dynamic routes after refresh, retain input while switching pages, and remove the previous account's routes on logout.

Vue Router already provides matching, dynamic registration, navigation and guards. vmo-router connects local templates, dynamic definitions, recovery and cleanup into one workflow, reducing repeated application code.

Compared with native Vue Router ​

RequirementNative Vue Routervmo-router
Map server configuration to local componentsBuild a mapping and RouteRecordRaw objectsSelect a template key and deep-merge instance overrides
Navigate to an unregistered nameCall addRoute before pushInclude a template in push/replace to register on demand
Restore dynamic routes after refreshSave definitions and rebuild routes yourselfSupply synchronous getter/setter callbacks; restore during createRouter
Clean up on logoutTrack registrations and synchronize caches yourselfTrack dynamic registrations independently and clean descendants and caches
Cache different pages from one templateArrange component names and include yourselfName lazy components after route instances and manage an include list
Confirm leaving unsaved pagesImplement guards and refresh listenersUse confirmation callbacks, switches and lifecycle listeners

Dynamic registration and lazy loading come from Vue Router; component instance caching comes from Vue. This library organizes configuration and synchronizes state around those capabilities.

When it fits ​

It fits Vue 3 administration applications driven by menu configuration, multiple business pages sharing templates, and dynamic pages that must survive refresh. Components remain local, definitions can be serialized, and registration, navigation, recovery and cleanup use the same definition.

Simple applications with fixed pages can use Vue Router directly. Menu rendering, tab UI, backend authorization, account isolation and business data persistence remain application responsibilities. The library does not execute arbitrary server-provided component code, or automatically implement authorization and KeepAlive from meta fields.

Read dynamic routes, route configuration caching and KeepAlive, or run the minimal getting started example.