Files
smt-used-car-h5/store/counter.js
T

18 lines
298 B
JavaScript
Raw Normal View History

2026-03-11 11:15:33 +08:00
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', {
state: () => ({
count: 0
}),
getters: {
doubleCount: (state) => state.count * 2
},
actions: {
increment() {
this.count++
},
decrement() {
this.count--
}
}
})