Răsfoiți Sursa

选择语言后刷新

visuddhinanda 3 săptămâni în urmă
părinte
comite
c1615ccbef
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      dashboard-v6/src/components/general/UiLangSelect.tsx

+ 4 - 3
dashboard-v6/src/components/general/UiLangSelect.tsx

@@ -15,7 +15,7 @@ const uiLang: IUiLang[] = [
   { key: "zh-Hant", label: "繁体中文" },
   { key: "zh-Hant", label: "繁体中文" },
 ];
 ];
 
 
-const UiLangSelectWidget = () => {
+const UiLangSelect = () => {
   /**
   /**
    * ✅ 初始值直接计算
    * ✅ 初始值直接计算
    */
    */
@@ -43,15 +43,16 @@ const UiLangSelectWidget = () => {
     set(key as string); // ← 只传一个参数
     set(key as string); // ← 只传一个参数
     const label = uiLang.find((i) => i.key === key)?.label;
     const label = uiLang.find((i) => i.key === key)?.label;
     setCurr(label);
     setCurr(label);
+    location.reload();
   };
   };
 
 
   return (
   return (
     <Dropdown menu={{ items, onClick }} placement="bottomRight">
     <Dropdown menu={{ items, onClick }} placement="bottomRight">
-      <Button ghost style={{ border: "unset" }} icon={<GlobalOutlined />}>
+      <Button type="text" icon={<GlobalOutlined />}>
         {curr}
         {curr}
       </Button>
       </Button>
     </Dropdown>
     </Dropdown>
   );
   );
 };
 };
 
 
-export default UiLangSelectWidget;
+export default UiLangSelect;