🐛 fix i18n init bug
This commit is contained in:
@@ -1,25 +1,12 @@
|
||||
import {defineStore} from 'pinia';
|
||||
import {ref} from 'vue';
|
||||
import pinia from "@/store/pinia.ts";
|
||||
import {parse, stringify} from "zipson/lib";
|
||||
import {ref} from "vue";
|
||||
|
||||
export const langStore = defineStore(
|
||||
'lang',
|
||||
() => {
|
||||
const lang = ref<string>('zh');
|
||||
|
||||
function setLang(value: string) {
|
||||
lang.value = value;
|
||||
}
|
||||
|
||||
function getLang() {
|
||||
return lang.value;
|
||||
}
|
||||
|
||||
return {
|
||||
lang,
|
||||
setLang,
|
||||
getLang,
|
||||
};
|
||||
},
|
||||
{
|
||||
@@ -28,14 +15,6 @@ export const langStore = defineStore(
|
||||
key: 'lang',
|
||||
storage: localStorage,
|
||||
paths: ["lang"],
|
||||
serializer: {
|
||||
deserialize: parse,
|
||||
serialize: stringify,
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
export function useLangStoreWithOut() {
|
||||
return langStore(pinia);
|
||||
}
|
||||
|
Reference in New Issue
Block a user