Skip to content

Commit

Permalink
fix(breadcrumb): 面包屑初始样式被覆盖
Browse files Browse the repository at this point in the history
  • Loading branch information
yatesmiao committed Apr 13, 2022
1 parent 3b82c6d commit 2d260ea
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/breadcrumb/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,20 @@ import { BreadcrumbItemProps } from './BreadcrumbProps';
import { BreadcrumbContext } from './BreadcrumbContext';

export const BreadcrumbItem = forwardRef<HTMLDivElement, BreadcrumbItemProps>((props, ref) => {
const { children, separator, disabled, maxItemWidth, maxWidth, href, to, target, router, replace, ...restProps } =
props;
const {
children,
separator,
disabled,
maxItemWidth,
maxWidth,
href,
to,
target,
router,
replace,
className,
...restProps
} = props;

const { maxItemWidthInContext, theme, separator: separatorInContext } = useContext(BreadcrumbContext);

Expand Down Expand Up @@ -58,7 +70,7 @@ export const BreadcrumbItem = forwardRef<HTMLDivElement, BreadcrumbItemProps>((p
);

return (
<div className={classNames(breadcrumbItemClassNames, theme)} ref={ref} {...restProps}>
<div className={classNames(breadcrumbItemClassNames, theme, className)} ref={ref} {...restProps}>
{itemContent}
<span className={separatorClassName}>{separatorContent}</span>
</div>
Expand Down

0 comments on commit 2d260ea

Please sign in to comment.