Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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, so RouterLink's default rendering doesn't apply. This component uses RouterLink's custom + v-slot API to render native <text> elements with @tap handlers while preserving isActive state for styling.
  • Programmatic navigationrouter.push(), router.back() work as expected.
  • Dynamic route params/users/:id with useRoute().params.

Getting Started

Install dependencies from the repo root:

pnpm install

Then build or run the dev server:

pnpm run dev
# or
pnpm run build