mall-app-b/peach/store/sys.js

32 lines
618 B
JavaScript
Raw Permalink Normal View History

2024-05-20 01:18:27 +08:00
import { defineStore } from "pinia";
2024-04-30 17:45:03 +08:00
const sys = defineStore({
2024-05-20 01:18:27 +08:00
id: "sys",
state: () => ({
theme: "", // 主题,
mode: "light", // 明亮模式、暗黑模式(暂未支持)
modeAuto: false, // 跟随系统
fontSize: 1, // 设置默认字号等级(0-4)
}),
getters: {},
actions: {
setTheme(theme = "") {
if (theme === "") {
this.theme = "orange";
} else {
this.theme = theme;
}
2024-04-30 17:45:03 +08:00
},
2024-05-20 01:18:27 +08:00
},
persist: {
enabled: true,
strategies: [
{
key: "sys-store",
},
],
},
});
2024-04-30 17:45:03 +08:00
2024-05-20 01:18:27 +08:00
export default sys;