You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
🧐 问题描述 [详细地描述问题,让大家都能理解]
renderFormItem 内部的text 需要根据语言而变化
💻 示例代码 [如果有必要,展示代码,线上示例,或仓库]
现有代码是这样
renderFormItem: (item, { defaultRender, ...rest }, form) => {
const status = form.getFieldValue('status');
if (
${status}
=== '0') {return false;
}
if (
${status}
=== '3') {return <Input {...rest} placeholder="请输入异常原因!" />;
}
return defaultRender(item);
},
有没有办法把中文部分换为I18n 函数调用?
renderFormItem: (item, { defaultRender, ...rest }, form) => {
const status = form.getFieldValue("status");
if (
${status}
=== "0") {return false;
}
if (
${status}
=== "3") {return <Input {...rest} placeholder={i18n("placeholder")} />;
}
return defaultRender(item);
},
i18n可以是I18n 函数
试了一下, 好像不行。
The text was updated successfully, but these errors were encountered: