Examples
A runnable example app lives in the examples/ directory of the repository. It wires up pages, dialogs, and controls with the Register pattern.
Run it locally
bash
git clone https://github.com/danh121097/vue-micro-router.git
cd vue-micro-router
bun install
bun run dev:exampleWhat it demonstrates
| Area | File | Shows |
|---|---|---|
| App shell | examples/App.vue | Mounting <MicroRouterView> with config + plugins |
| Plugin | examples/app-plugin.ts | defineFeaturePlugin with routes, dialogs, controls |
| Typed state | examples/auth-state.ts | Sharing reactive state alongside navigation |
| Pages | examples/pages/ | Page components reading props via useMicroState() |
| Dialogs | examples/dialogs/ | Modal dialogs with typed Attrs |
| Controls | examples/controls/ | Persistent HUD overlays |
Recipes
- Segment navigation — see Navigation & Routing
- Route guards — see Route Guards
- Dialogs — see Dialogs
- HUD controls — see GUI Controls
- Swipe-back gestures — see Gesture Navigation
- Session persistence — see State Serialization