Skip to content

Commit 71d0cb2

Browse files
committed
Add store (pinia) with current tab url
1 parent d8e73a4 commit 71d0cb2

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"private": true,
44
"version": "1.0.0",
55
"type": "module",
6+
"engines": {
7+
"node": ">=16.15.0",
8+
"pnpm": ">=7"
9+
},
610
"scripts": {
711
"dev": "vite build --mode development --watch",
812
"start": "vite build --watch --mode production",
@@ -11,6 +15,7 @@
1115
"script:zip": "powershell scripts/zip.ps1"
1216
},
1317
"dependencies": {
18+
"pinia": "^2.0.34",
1419
"tailwind": "^4.0.0",
1520
"vue": "^3.2.47"
1621
},

pnpm-lock.yaml

Lines changed: 39 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/store/appStore.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineStore } from 'pinia'
2+
3+
export const userTrackerStore = defineStore('tracker', {
4+
state: () => ({
5+
currentTabDomain: null as string | null,
6+
}),
7+
actions: {
8+
setCurrentTab(domain:string | null) {
9+
this.currentTabDomain = domain;
10+
},
11+
},
12+
})

0 commit comments

Comments
 (0)