All checks were successful
Build / build-and-test (push) Successful in 27s
[Style] 为主视图增加 16px 间距 更新 mdui-card 的右边距问题 (老问题了, 还是没有解决) [Base] 引入 VueUse 分离 Axios HTML 部分紧凑化
29 lines
630 B
JavaScript
29 lines
630 B
JavaScript
import { defineStore } from 'pinia'
|
|
import { reactive } from 'vue'
|
|
import { useStorage, watchWithFilter, debounceFilter } from '@vueuse/core'
|
|
|
|
const CURRENT_VERSION = 1
|
|
|
|
const DEFAULT_SETTINGS = {
|
|
version: CURRENT_VERSION,
|
|
darkTheme: false,
|
|
autoTheme: true,
|
|
colorScheme: '#890000'
|
|
}
|
|
|
|
export const useAppSettingStore = defineStore('appSetting', () => {
|
|
const stored = useStorage('app-settings', DEFAULT_SETTINGS)
|
|
if (stored.version !== CURRENT_VERSION) {
|
|
Object.assign(stored, DEFAULT_SETTINGS)
|
|
}
|
|
function resetSettings() {
|
|
Object.assign(stored, DEFAULT_SETTINGS)
|
|
}
|
|
return {
|
|
value: stored,
|
|
resetSettings,
|
|
}
|
|
})
|
|
|
|
|