mosdns/web-ui/src/stores/counter.ts
dengxiongjian ee06785e08
Some checks are pending
Test mosdns / build (push) Waiting to run
开发web管理
2025-10-15 22:20:27 +08:00

13 lines
306 B
TypeScript

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 }
})