liveh5-nuxt/app/composables/counter.ts

19 lines
252 B
TypeScript
Raw Normal View History

2025-01-08 05:26:12 +00:00
import { defineStore } from 'pinia'
const useCounter = defineStore('counter', () => {
const count = ref(0)
function increment() {
count.value++
}
return {
count,
increment,
}
}, {
persist: true,
})
export default useCounter