-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(ProFormComponent): fix render bug #9207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,8 @@ | ||||||
import type { RadioGroupProps, RadioProps } from 'antd'; | ||||||
import { Radio } from 'antd'; | ||||||
import React from 'react'; | ||||||
import FieldRadio from '../../../field/components/Radio'; | ||||||
import { ProConfigProvider } from '../../../provider'; | ||||||
import { runFunction } from '../../../utils'; | ||||||
import type { | ||||||
ProFormFieldItemProps, | ||||||
|
@@ -32,21 +34,41 @@ const RadioGroup: React.FC<ProFormRadioGroupProps> = React.forwardRef( | |||||
ref: any, | ||||||
) => { | ||||||
return ( | ||||||
<ProField | ||||||
valueType={radioType === 'button' ? 'radioButton' : 'radio'} | ||||||
ref={ref} | ||||||
valueEnum={runFunction<[any]>(valueEnum, undefined)} | ||||||
{...rest} | ||||||
fieldProps={{ | ||||||
options, | ||||||
layout, | ||||||
...fieldProps, | ||||||
<ProConfigProvider | ||||||
valueTypeMap={{ | ||||||
radio: { | ||||||
render: (text, props) => <FieldRadio {...props} text={text} />, | ||||||
formItemRender: (text, props) => ( | ||||||
<FieldRadio {...props} text={text} /> | ||||||
), | ||||||
}, | ||||||
radioButton: { | ||||||
render: (text, props) => { | ||||||
console.log(props); | ||||||
return <FieldRadio radioType={'button'} {...props} text={text} />; | ||||||
}, | ||||||
formItemRender: (text, props) => ( | ||||||
<FieldRadio radioType={'button'} {...props} text={text} /> | ||||||
), | ||||||
}, | ||||||
}} | ||||||
proFieldProps={proFieldProps} | ||||||
filedConfig={{ | ||||||
customLightMode: true, | ||||||
}} | ||||||
/> | ||||||
> | ||||||
<ProField | ||||||
valueType={radioType === 'button' ? 'radioButton' : 'radio'} | ||||||
ref={ref} | ||||||
valueEnum={runFunction<[any]>(valueEnum, undefined)} | ||||||
{...rest} | ||||||
fieldProps={{ | ||||||
options, | ||||||
layout, | ||||||
...fieldProps, | ||||||
}} | ||||||
proFieldProps={proFieldProps} | ||||||
filedConfig={{ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修复属性名称中的拼写错误。
- filedConfig={{
+ fieldConfig={{ 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
customLightMode: true, | ||||||
}} | ||||||
/> | ||||||
</ProConfigProvider> | ||||||
); | ||||||
}, | ||||||
); | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除调试用的 console.log 语句。
生产代码中不应该包含调试用的 console.log 语句,这会在控制台产生不必要的输出。
- console.log(props);
📝 Committable suggestion
🤖 Prompt for AI Agents