From 003377c978cff07bb16e33a115518d53d394a043 Mon Sep 17 00:00:00 2001 From: ZongLiang <649236041@qq.com> Date: Wed, 8 Jun 2022 09:50:21 +0800 Subject: [PATCH] Update SelectLang.tpl --- .../src/templates/SelectLang.tpl | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/plugin-locale/src/templates/SelectLang.tpl b/packages/plugin-locale/src/templates/SelectLang.tpl index c47c2ef3..b1e708c5 100644 --- a/packages/plugin-locale/src/templates/SelectLang.tpl +++ b/packages/plugin-locale/src/templates/SelectLang.tpl @@ -424,18 +424,28 @@ export const SelectLang: React.FC = (props) => { const menuItemStyle = { minWidth: "160px" }; const menuItemIconStyle = { marginRight: "8px" }; const langMenu = ( - - {allLangUIConfig.map((localeObj) => { - return ( - - - {localeObj?.icon || "🌐"} - - {localeObj?.label || "en-US"} - - ); + { + return { + key: localeObj.lang || localeObj.key, + style: menuItemStyle, + label: ( + <> + + {localeObj?.icon || "🌐"} + + {localeObj?.label || "en-US"} + + ), + }; })} - + /> ); const inlineStyle = {