@vuecs/link
<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. -
toorhref— route location object/string for router navigation,hreffor plain anchors;querymerging included. - Stateful props —
activeanddisabledflow into rendering and clicks;clickedemit for selection-style flows (used by@vuecs/navigation's url-less section switchers). - Prefetch control —
:prefetchforwarded to<NuxtLink>(defaulttrue).
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.