umi icon indicating copy to clipboard operation
umi copied to clipboard

[Bug] plugin-locale langMenu 使用items而不是children

Open ytx222 opened this issue 2 years ago • 1 comments

What happens?

Warning: [antd: Menu] children will be removed in next major version. Please use items instead.

问题在 https://github.com/umijs/umi/blob/master/packages/plugins/libs/locale/SelectLang.tpl 425行 需要将chidren修改为items 比如这样

<Menu selectedKeys={[selectedLang]} onClick={handleClick} items={
	allLangUIConfig.map((localeObj) => {
	  return (
		{
		  key:localeObj.lang || localeObj.key,
		  icon: localeObj?.icon || "🌐",
		  label: localeObj?.label || "en-US",
		}
	  );
	})
  }>
</Menu>

Mini Showcase Repository(REQUIRED)

Please provide a minimal reproduction then upload to your GitHub. 请提供 最小重现,并上传到你的 GitHub 仓库

任意项目都可以,鼠标悬浮到翻译按钮上,控制台报错

Context

  • Umi Version: 4.0.15
  • Node Version:16.15.1
  • Platform:windows 10

ytx222 avatar Aug 29 '22 09:08 ytx222

+1

vdfor avatar Sep 20 '22 02:09 vdfor

最新版本已经改成 items 了。

fz6m avatar Jan 05 '23 04:01 fz6m