Skip to content
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

fix: classname use repeatedly #6278

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/components/form/form-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ type FormItemLayoutProps = Pick<

const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
const {
className,
style,
extra,
label,
Expand Down Expand Up @@ -208,15 +207,10 @@ const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
prefix={layout === 'horizontal' && labelElement}
extra={extra}
description={description}
className={classNames(
classPrefix,
className,
`${classPrefix}-${layout}`,
{
[`${classPrefix}-hidden`]: hidden,
[`${classPrefix}-has-error`]: props.errors.length,
}
)}
className={classNames(classPrefix, `${classPrefix}-${layout}`, {
[`${classPrefix}-hidden`]: hidden,
[`${classPrefix}-has-error`]: props.errors.length,
})}
disabled={disabled}
onClick={props.onClick}
clickable={props.clickable}
Expand All @@ -239,7 +233,6 @@ const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
export const FormItem: FC<FormItemProps> = props => {
const {
// 样式相关
className,
style,
// FormItem 相关
label,
Expand Down Expand Up @@ -335,7 +328,6 @@ export const FormItem: FC<FormItemProps> = props => {
return withNativeProps(
props,
<FormItemLayout
className={className}
style={style}
label={label}
extra={extra}
Expand Down
Loading