Replies: 1 comment
-
I managed to read a persisted locale from store in main.js. The relevant code looks something like this: import { Vue, createApp } from 'vue';
import App from './App.vue';
import i18n from './i18n';
import { createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import { useMainStore } from '@/store';
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
const app = createApp(App).use(pinia)
.use(i18n);
const mainStore = useMainStore();
i18n.global.locale.value = mainStore.locale;
app.mount('#app'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i use vue3.2.6 vue-i18n9.1.7 pinia2.0.13
and i need use store in creatI18n()like
i want,and i read the doc,but is also throw error
Beta Was this translation helpful? Give feedback.
All reactions