mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-04 04:58:16 +08:00
a2f7d6d062
closes vueComponent/ant-design-vue#5765 Add `compatConfig: { MODE: 3 }` to all component definitions to signal to `@vue/compat` not to use any Vue 2 compatibility features.
33 lines
1014 B
Vue
33 lines
1014 B
Vue
import type { ExtractPropTypes } from 'vue';
|
|
import { defineComponent } from 'vue';
|
|
import { flattenChildren } from '../_util/props-util';
|
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
|
|
|
export const breadcrumbSeparatorProps = () => ({
|
|
prefixCls: String,
|
|
});
|
|
export type BreadcrumbSeparatorProps = Partial<
|
|
ExtractPropTypes<ReturnType<typeof breadcrumbSeparatorProps>>
|
|
>;
|
|
|
|
export default defineComponent({
|
|
compatConfig: { MODE: 3 },
|
|
name: 'ABreadcrumbSeparator',
|
|
__ANT_BREADCRUMB_SEPARATOR: true,
|
|
inheritAttrs: false,
|
|
props: breadcrumbSeparatorProps(),
|
|
setup(props, { slots, attrs }) {
|
|
const { prefixCls } = useConfigInject('breadcrumb', props);
|
|
|
|
return () => {
|
|
const { separator, class: className, ...restAttrs } = attrs;
|
|
const children = flattenChildren(slots.default?.());
|
|
return (
|
|
<span class={[`${prefixCls.value}-separator`, className]} {...restAttrs}>
|
|
{children.length > 0 ? children : '/'}
|
|
</span>
|
|
);
|
|
};
|
|
},
|
|
});
|