feat: pattern config

This commit is contained in:
ex_zhangwenlei@exiot.cmcc
2024-01-11 23:53:53 +08:00
parent 53af03648e
commit 2ba3bb036b
18 changed files with 621 additions and 147 deletions

30
src/store/system.ts Normal file
View File

@@ -0,0 +1,30 @@
import { defineStore } from 'pinia';
// import { IPrizeConfig } from '@/types/storeType';
export const useSystem = defineStore('system', {
state() {
return {
isMobile:false
};
},
getters: {
getIsMobile(state) {
return state.isMobile;
},
},
actions: {
setIsMobile(isMobile: boolean) {
this.isMobile = isMobile;
},
},
persist: {
enabled: true,
strategies: [
{
// 如果要存储在localStorage中
// storage: localStorage,
// key: 'globalConfig',
// paths: ['globalConfig'],
},
],
},
})