use-locale.js 332 B

12345678910111213141516171819
  1. import { defineStore } from 'pinia';
  2. import { LANGUAGE_ENGLISH, LANGUAGE_CHINESE } from '../variables';
  3. /**
  4. * 多语言
  5. */
  6. export const useLocaleStore = defineStore('locale', {
  7. state: () => {
  8. return {
  9. value: LANGUAGE_CHINESE
  10. };
  11. },
  12. actions: {
  13. updateLanguage(lang) {
  14. this.value = lang;
  15. }
  16. }
  17. });