1234567891011121314151617181920212223242526272829303132 |
- import { defineStore } from 'pinia';
- import app from './app';
- const sys = defineStore({
- id: 'sys',
- state: () => ({
- theme: '',
- mode: 'light',
- modeAuto: false,
- fontSize: 1,
- }),
- getters: {},
- actions: {
- setTheme(theme = '') {
- if (theme === '') {
- this.theme = app().template?.basic.theme || 'orange';
- } else {
- this.theme = theme;
- }
- },
- },
- persist: {
- enabled: true,
- strategies: [
- {
- key: 'sys-store',
- },
- ],
- },
- });
- export default sys;
|