import { defineStore } from 'pinia'; export const userStore = defineStore('user', { state: () => { return { count: 1, arr: <any>[], }; }, getters: { myCount(state) { console.log('调用了myCount'); return state.count + 1; }, }, actions: { changeState(num: number) { this.count += num; this.arr.push(num); }, }, });