feat: pattern config
This commit is contained in:
30
src/store/system.ts
Normal file
30
src/store/system.ts
Normal 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'],
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user