ci: 集成 pinia 提供主题持久化
This commit is contained in:
parent
0f7d25bc09
commit
ae75cffa9b
@ -136,7 +136,9 @@
|
|||||||
></lay-color-picker
|
></lay-color-picker
|
||||||
>
|
>
|
||||||
<lay-color-picker
|
<lay-color-picker
|
||||||
v-model="appStore.themeVariable['--global-dark-background-color']"
|
v-model="
|
||||||
|
appStore.themeVariable['--global-dark-background-color']
|
||||||
|
"
|
||||||
></lay-color-picker>
|
></lay-color-picker>
|
||||||
|
|
||||||
<lay-button fluid="true">导 出 配 置</lay-button>
|
<lay-button fluid="true">导 出 配 置</lay-button>
|
||||||
|
@ -3,7 +3,7 @@ import { App, createApp as _createApp } from "vue";
|
|||||||
import { createRouter } from "./router/index";
|
import { createRouter } from "./router/index";
|
||||||
import { Router } from "vue-router";
|
import { Router } from "vue-router";
|
||||||
import layui from "@layui/layui-vue";
|
import layui from "@layui/layui-vue";
|
||||||
import Store from './store';
|
import Store from "./store";
|
||||||
import "@layui/layui-vue/lib/index.css";
|
import "@layui/layui-vue/lib/index.css";
|
||||||
import LayCode from "./components/LayCode.vue";
|
import LayCode from "./components/LayCode.vue";
|
||||||
import LaySearch from "./components/LaySearch.vue";
|
import LaySearch from "./components/LaySearch.vue";
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from "pinia";
|
||||||
|
|
||||||
export const useAppStore = defineStore({
|
export const useAppStore = defineStore({
|
||||||
id: 'app',
|
id: "app",
|
||||||
state: () => {
|
state: () => {
|
||||||
return {
|
return {
|
||||||
theme: 'light',
|
theme: "light",
|
||||||
themeVariable: {
|
themeVariable: {
|
||||||
"--global-primary-color": "#009688",
|
"--global-primary-color": "#009688",
|
||||||
"--global-normal-color": "#1e9fff",
|
"--global-normal-color": "#1e9fff",
|
||||||
@ -21,24 +21,21 @@ export const useAppStore = defineStore({
|
|||||||
"--global-neutral-color-7": "#cccccc",
|
"--global-neutral-color-7": "#cccccc",
|
||||||
"--global-neutral-color-8": "#c2c2c2",
|
"--global-neutral-color-8": "#c2c2c2",
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
},
|
|
||||||
getters: {
|
|
||||||
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
getters: {},
|
||||||
|
actions: {},
|
||||||
persist: {
|
persist: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
strategies: [
|
strategies: [
|
||||||
{
|
{
|
||||||
key: 'theme',
|
key: "theme",
|
||||||
storage: localStorage
|
storage: localStorage,
|
||||||
},{
|
},
|
||||||
key: 'themeVariable',
|
{
|
||||||
storage: localStorage
|
key: "themeVariable",
|
||||||
}
|
storage: localStorage,
|
||||||
]
|
},
|
||||||
}
|
],
|
||||||
})
|
},
|
||||||
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { createPinia } from 'pinia'
|
import { createPinia } from "pinia";
|
||||||
import piniaPluginPersist from 'pinia-plugin-persist'
|
import piniaPluginPersist from "pinia-plugin-persist";
|
||||||
|
|
||||||
const store = createPinia();
|
const store = createPinia();
|
||||||
store.use(piniaPluginPersist);
|
store.use(piniaPluginPersist);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user