vue-link-interceptor 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -0
  2. package/package.json +4 -3
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # vue-link-interceptor
2
+
3
+ Vue 3 plugin to intercept all `<a>` tag clicks in your SPA. Handle internal routing and external link modifications with ease.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install vue-link-interceptor
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { linkInterceptorPlugin } from 'vue-link-interceptor'
15
+
16
+ app.use(linkInterceptorPlugin, {
17
+ onInternalLink(ctx) {
18
+ ctx.preventDefault()
19
+ router.push(ctx.path)
20
+ },
21
+ onExternalLink(ctx) {
22
+ ctx.url.searchParams.set('utm_source', 'myapp')
23
+ },
24
+ })
25
+ ```
26
+
27
+ ## Docs & Playground
28
+
29
+ https://babu-ch.github.io/link-interceptor/?fw=vue
30
+
31
+ ## License
32
+
33
+ [MIT](https://github.com/babu-ch/link-interceptor/blob/main/LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-link-interceptor",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Vue 3 plugin to intercept all <a> tag clicks in your SPA — handle internal routing and external link modifications with ease.",
5
5
  "keywords": [
6
6
  "anchor",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "author": "babu-ch",
16
16
  "license": "MIT",
17
- "homepage": "https://github.com/babu-ch/link-interceptor/tree/main/packages/vue",
17
+ "homepage": "https://babu-ch.github.io/link-interceptor/?fw=vue",
18
18
  "repository": {
19
19
  "type": "git",
20
20
  "url": "git+https://github.com/babu-ch/link-interceptor.git",
@@ -28,6 +28,7 @@
28
28
  "node": ">=18.0.0"
29
29
  },
30
30
  "files": [
31
+ "README.md",
31
32
  "dist"
32
33
  ],
33
34
  "type": "module",
@@ -54,7 +55,7 @@
54
55
  "typescript": "^5.8.2",
55
56
  "vite-plus": "^0.1.14",
56
57
  "vue": "^3.5.31",
57
- "link-interceptor": "0.1.0"
58
+ "link-interceptor": "0.1.2"
58
59
  },
59
60
  "scripts": {
60
61
  "build": "vp pack",