From 5e4d41d1dfeaaeca731b3c5496377214ec6e557f Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sat, 26 Oct 2024 12:10:47 +0100 Subject: bootstrap project --- src/stores/counter.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/stores/counter.ts (limited to 'src/stores/counter.ts') diff --git a/src/stores/counter.ts b/src/stores/counter.ts new file mode 100644 index 0000000..b6757ba --- /dev/null +++ b/src/stores/counter.ts @@ -0,0 +1,12 @@ +import { ref, computed } from 'vue' +import { defineStore } from 'pinia' + +export const useCounterStore = defineStore('counter', () => { + const count = ref(0) + const doubleCount = computed(() => count.value * 2) + function increment() { + count.value++ + } + + return { count, doubleCount, increment } +}) -- cgit v1.2.3-70-g09d2