You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
530 B
23 lines
530 B
/**
|
|
* 本地持久化配置项
|
|
*/
|
|
import { toValue } from 'vue';
|
|
import { createGlobalState, useStorage } from '@vueuse/core';
|
|
|
|
export const useGlobalSettings = createGlobalState(() => {
|
|
const settings = useStorage('settings', {
|
|
showMapHd: true,
|
|
showFieldFill: true,
|
|
showFieldName: true,
|
|
});
|
|
|
|
const valueOf = () => toValue(settings);
|
|
|
|
const set = (key, val) => {
|
|
if (key in settings.value) settings.value[key] = val;
|
|
};
|
|
|
|
return { set, valueOf };
|
|
});
|
|
|
|
export default null;
|
|
|