feat: 添加头像信息封装

This commit is contained in:
橙子
2023-03-13 23:24:10 +08:00
parent 8e56667760
commit 9600e450af
7 changed files with 87 additions and 10 deletions

View File

@@ -1,18 +1,21 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const userStore = defineStore('user',
const useUserStore = defineStore('user',
{
state: () => ({
counter: 0,
token: '',
name: '',
avatar: '',
roles: ['admin'],
permissions: ['*:*:*']
}),
getters: {
doubleCount: (state) => state.counter*2,
},
actions: {
increment() {
this.counter+=10
}
},
}
)
})
export default useUserStore;