npm.io
2.0.3 • Published 2d ago

@vuecs/link

Licence
Apache-2.0
Version
2.0.3
Deps
0
Size
34 kB
Vulns
0
Weekly
0
Stars
3

npm version CI license

<VCLink> — one anchor for every routing setup, part of vuecs. Detects the environment and renders <NuxtLink>, <RouterLink>, or a plain <a> — so library components (and your own) never hard-code a router.

What's inside

  • Auto-detection — Nuxt → <NuxtLink>, vue-router → <RouterLink>, neither → <a>. No configuration, no direct router dependency.
  • to or href — route location object/string for router navigation, href for plain anchors; query merging included.
  • Stateful propsactive and disabled flow into rendering and clicks; clicked emit for selection-style flows (used by @vuecs/navigation's url-less section switchers).
  • Prefetch control:prefetch forwarded to <NuxtLink> (default true).

Installation

npm install @vuecs/link

Usage

<VCLink to="/dashboard">Dashboard</VCLink>
<VCLink href="https://github.com/tada5hi/vuecs" target="_blank">GitHub</VCLink>
<VCLink :to="{ name: 'user', params: { id } }" :disabled="!canVisit">Profile</VCLink>

Documentation

Full reference: vuecs.dev/components/link

License

Made with

Published under Apache 2.0 License.