fix: breadcrumb separator display (#3522)
* fix: breadcrumb separator display * chore: update breadcrumbpull/3538/head
parent
8a807caca2
commit
a6c3eae304
|
@ -6,6 +6,7 @@ import { getSlot } from '../_util/props-util';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ABreadcrumbSeparator',
|
name: 'ABreadcrumbSeparator',
|
||||||
__ANT_BREADCRUMB_SEPARATOR: true,
|
__ANT_BREADCRUMB_SEPARATOR: true,
|
||||||
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
},
|
},
|
||||||
|
@ -16,10 +17,15 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { prefixCls: customizePrefixCls } = this;
|
const { prefixCls: customizePrefixCls } = this;
|
||||||
|
const { separator, class: className, ...restAttrs } = this.$attrs;
|
||||||
const getPrefixCls = this.configProvider.getPrefixCls;
|
const getPrefixCls = this.configProvider.getPrefixCls;
|
||||||
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
const prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
|
||||||
|
|
||||||
const children = getSlot(this);
|
const children = getSlot(this);
|
||||||
return <span class={`${prefixCls}-separator`}>{children || '/'}</span>;
|
return (
|
||||||
|
<span class={[`${prefixCls}-separator`, className]} {...restAttrs}>
|
||||||
|
{children.length > 0 ? children : '/'}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue