vue-link-interceptor
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
Related Packages
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 |