You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
306 B

5 months ago
  1. import { ref, computed } from 'vue'
  2. import { defineStore } from 'pinia'
  3. export const useCounterStore = defineStore('counter', () => {
  4. const count = ref(0)
  5. const doubleCount = computed(() => count.value * 2)
  6. function increment() {
  7. count.value++
  8. }
  9. return { count, doubleCount, increment }
  10. })