aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/stores/counter.ts
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2022-10-22 19:07:14 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2022-10-22 19:07:14 +0300
commitd963c3f40f075c05d70af32f44ed2bec8e00bc37 (patch)
tree33a362746201ebec46e7c741e40a530d5f32e38b /frontend/src/stores/counter.ts
downloadlphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.gz
lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.tar.bz2
lphub-d963c3f40f075c05d70af32f44ed2bec8e00bc37.zip
init
Diffstat (limited to 'frontend/src/stores/counter.ts')
-rw-r--r--frontend/src/stores/counter.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/frontend/src/stores/counter.ts b/frontend/src/stores/counter.ts
new file mode 100644
index 0000000..b6757ba
--- /dev/null
+++ b/frontend/src/stores/counter.ts
@@ -0,0 +1,12 @@
1import { ref, computed } from 'vue'
2import { defineStore } from 'pinia'
3
4export const useCounterStore = defineStore('counter', () => {
5 const count = ref(0)
6 const doubleCount = computed(() => count.value * 2)
7 function increment() {
8 count.value++
9 }
10
11 return { count, doubleCount, increment }
12})