vue-link-interceptor

Vue 3 plugin to intercept all tag clicks in your SPA — handle internal routing and external link modifications with ease.
5,447
Install
npm install vue-link-interceptor
Latest Version:0.1.2
Vue:3
License:MIT
Last Updated:Mar 31, 2026
Links: GitHub  ·  npm
Maintainer: babch

vue-link-interceptor

Vue 3 plugin to intercept all <a> tag clicks in your SPA. Handle internal routing and external link modifications with ease.

Install

npm install vue-link-interceptor

Usage

import { linkInterceptorPlugin } from 'vue-link-interceptor'

app.use(linkInterceptorPlugin, {
  onInternalLink(ctx) {
    ctx.preventDefault()
    router.push(ctx.path)
  },
  onExternalLink(ctx) {
    ctx.url.searchParams.set('utm_source', 'myapp')
  },
})

Docs & Playground

https://babu-ch.github.io/link-interceptor/?fw=vue

License

MIT

Related Packages

pinia-plugin-router

A pinia plugin that help use vue-router in pinia

4,356
route-interceptor

A front-end generic route interceptor

1,866 10
vue-cli-plugin-prerender-spa

Vue CLI plugin to add prerendering to your application

5,065 173
@styzy/vue-tab-router

A Tab Router Plugins For Vue.js

948 8
vue-router-spa-tabs

Tabbed Navigation for Vue Router in Single Page Applications

985 0

Version History

Version Released Vue License
0.1.2 ^3.0.0 MIT
0.1.1 ^3.0.0 MIT
0.1.0 ^3.0.0 MIT