jhzh
2024-08-28 4c8a466f75bf9eca29e9b5c9ad15db5757e5035d
src/components/Language/index.vue
@@ -37,24 +37,23 @@
      actions: [
        {
          text: "English",
          icon: require("@/assets/ico/english.png"),
          lang: "en",
        },
        {
          text: "繁体中文",
          icon: require("@/assets/ico/tw.png"),
          lang: "zh-TW",
          text: "简体中文",
          lang: "zh-CN",
        },
        { text: "हिंदी", icon: require("@/assets/ico/india.png"), lang: "hi" },
        { text: "한국인", icon: require("@/assets/ico/india.png"), lang: "ko" },
        { text: "हिंदी", lang: "hi" },
        {
          text: "ภาษาไทย",
          icon: require("@/assets/ico/india.png"),
          lang: "th",
        },
          text: "Deutsch",
          lang: "de",
        }, //德语
        {
          text: "Français",
          lang: "fr",
        }, //法语
        {
          text: "日本語にほんご",
          icon: require("@/assets/ico/india.png"),
          lang: "ja",
        },
      ],
@@ -63,11 +62,11 @@
  mounted() {
    this.$emit(
      "onChange",
      this.getText(window.localStorage.getItem("language") || "zh-CN")
      this.getText(window.localStorage.getItem("language"))
    );
  },
  methods: {
    getText(val) {
    getText(val = "hi") {
      let arr = this.actions.filter((item) => item.lang === val);
      return arr[0].text;
    },