Sfoglia il codice sorgente

选择语言后刷新

visuddhinanda 3 settimane fa
parent
commit
c1615ccbef
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  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: "繁体中文" },
 ];
 
-const UiLangSelectWidget = () => {
+const UiLangSelect = () => {
   /**
    * ✅ 初始值直接计算
    */
@@ -43,15 +43,16 @@ const UiLangSelectWidget = () => {
     set(key as string); // ← 只传一个参数
     const label = uiLang.find((i) => i.key === key)?.label;
     setCurr(label);
+    location.reload();
   };
 
   return (
     <Dropdown menu={{ items, onClick }} placement="bottomRight">
-      <Button ghost style={{ border: "unset" }} icon={<GlobalOutlined />}>
+      <Button type="text" icon={<GlobalOutlined />}>
         {curr}
       </Button>
     </Dropdown>
   );
 };
 
-export default UiLangSelectWidget;
+export default UiLangSelect;