Skip to content

Commit a6c3eae

Browse files
authored
fix: breadcrumb separator display (#3522)
* fix: breadcrumb separator display * chore: update breadcrumb
1 parent 8a807ca commit a6c3eae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/breadcrumb/BreadcrumbSeparator.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { getSlot } from '../_util/props-util';
66
export default defineComponent({
77
name: 'ABreadcrumbSeparator',
88
__ANT_BREADCRUMB_SEPARATOR: true,
9+
inheritAttrs: false,
910
props: {
1011
prefixCls: PropTypes.string,
1112
},
@@ -16,10 +17,15 @@ export default defineComponent({
1617
},
1718
render() {
1819
const { prefixCls: customizePrefixCls } = this;
20+
const { separator, class: className, ...restAttrs } = this.$attrs;
1921
const getPrefixCls = this.configProvider.getPrefixCls;
2022
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
2123

2224
const children = getSlot(this);
23-
return <span class={`${prefixCls}-separator`}>{children || '/'}</span>;
25+
return (
26+
<span class={[`${prefixCls}-separator`, className]} {...restAttrs}>
27+
{children.length > 0 ? children : '/'}
28+
</span>
29+
);
2430
},
2531
});

0 commit comments

Comments
 (0)