@vue-lynx-example/vue-router
v0.2.0
Published
Vue-Lynx + Vue Router demo using createMemoryHistory
Readme
Vue Router Example
Demonstrates Vue Router running in a Lynx environment using createMemoryHistory().
Why Memory History?
Lynx has no window.location or History API, so the standard createWebHistory() and createWebHashHistory() won't work. createMemoryHistory() keeps all routing state in-process — similar to React Router's MemoryRouter or TanStack Router's memory history.
Key Patterns
NavLink.vue— Lynx has no<a>tag, soRouterLink's default rendering doesn't apply. This component usesRouterLink'scustom+v-slotAPI to render native<text>elements with@taphandlers while preservingisActivestate for styling.- Programmatic navigation —
router.push(),router.back()work as expected. - Dynamic route params —
/users/:idwithuseRoute().params.
Getting Started
Install dependencies from the repo root:
pnpm installThen build or run the dev server:
pnpm run dev
# or
pnpm run build