conststoremainStore()// 监听pinia中整个statestore.$subscribe((mutation,state){console.log(state);})// 监听pinia中整个statewatch(store.$state,(newValue,oldValue){console.log(newValue,oldValue);})// 只监听pinia中某一个值的变化watch(()store.count,(newValue,oldValue){console.log(newValue,oldValue);})参考vue中监听pinia中整个state的变化和只监听state中某一个值的变化