This commit is contained in:
X1627315083
2025-10-09 09:35:36 +08:00
parent cc8c064d9c
commit bc8e03180e
107 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
// 每一个存储的模块命名规则use开头store结尾
import { defineStore } from 'pinia'
export const useUserInfoStore = defineStore({
id: 'userInfo', // 必须指明唯一的pinia仓库的id
state: () => {
return {
num: 0,
name: '张三',
token: ''
}
},
getters: {
doubleCount: (state) => state.num * 2
},
actions: {
changeNum() {
this.num++
},
loginOut() {
// 处理退出登录的一些逻辑
return new Promise((rez) => {
rez('111')
})
}
}
})