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:Wizard组件中角标显示异常 Closes #5019 #9296

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions packages/amis-ui/scss/components/_wizard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
}
}

.#{$ns}Badge-Button {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看看能否统一处理一下,现在能添加Badge的组件都会受到影响

width: auto;
height: auto;
border: none;
}

ul li.active {
color: var(--info);
}
Expand Down
12 changes: 11 additions & 1 deletion packages/amis-ui/src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,18 @@ export class Badge extends React.Component<BadgeProps, object> {
></div>
) : null;

const {children: badgeChildren} = this.props as any;
const isChildrenTypeButton: boolean =
badgeChildren?.props?.type === 'button';

return (
<div className={cx('Badge', className)}>
<div
className={cx(
!isChildrenTypeButton || 'Badge-Button',
'Badge',
className
)}
>
{children}
{isDisplay
? this.renderBadge(
Expand Down
Loading