night-cherry пре 1 месец
родитељ
комит
06b29a2706
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      index.js

+ 3 - 1
index.js

@@ -111,12 +111,14 @@ const app=createApp({
   setup(){
     const { locale,t } = useI18n();
     console.log("-------get locale--------");
-      console.log(locale);
+      console.log("locale : "+locale);
 //    this.locale=locale;
 //    在根文件直接使用locale需要绑定一个locale变量至浏览器对象Window
 //    否则无法让methods中的方法调用其中的变量(全局变量)
 //    如果封装在组件中,然后提供给父组件使用,则直接定义函数即可
     window.locale=locale;
+    this.locale=locale;
+    console.log("this.local : "+this.locale);
     console.log("-------after get locale--------");
   }
 }).use(i18n).use(router).use(ElementPlus).mount("#app");