feat(too): to

This commit is contained in:
ex_zhangwenlei@exiot.cmcc
2024-01-10 01:04:51 +08:00
parent f0a62aacb5
commit 3283a2d975
9 changed files with 5 additions and 246 deletions

View File

@@ -1,10 +1,8 @@
import { useUserStore } from './user';
import {usePersonConfig} from './personConfig';
import { usePrizeConfig } from './prizeConfig';
import {useGlobalConfig} from './globalConfig';
export default function useStore() {
return {
user: useUserStore(),
personConfig:usePersonConfig(),
prizeConfig:usePrizeConfig(),
globalConfig:useGlobalConfig()

View File

@@ -1,34 +0,0 @@
import { defineStore } from 'pinia';
import { IUser } from '@/types/user';
export const useUserStore = defineStore('user', {
state() {
return {
userList: [] as IUser[],
};
},
getters: {
getUserList(state) {
return state.userList;
},
},
actions: {
setUserList() {
const resList: IUser[] = [
{ name: '张三', age: 18 },
{ name: '李四', age: 19 },
];
this.userList = resList;
},
},
persist: {
enabled: true,
strategies: [
{
// 如果要存储在localStorage中
// storage: localStorage,
paths: ['userList'],
},
],
},
});