fix(FloatButton): BackTop attribute invalid (#7009)

* fix(FloatButton): BackTop attribute invalid

* fix: attribute props

* fix: Remove default slot

---------

Co-authored-by: undefined <undefined>
pull/7025/head
selicens 1 year ago committed by GitHub
parent 398710cf1b
commit f1bcf2093a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,22 +110,21 @@ const BackTop = defineComponent({
});
const floatButtonGroupContext = useInjectFloatButtonGroupContext();
return () => {
const defaultElement = (
<div class={`${prefixCls.value}-content`}>
<div class={`${prefixCls.value}-icon`}>
<VerticalAlignTopOutlined />
</div>
</div>
);
const { description, type, shape, tooltip, badge } = props;
const floatButtonProps = {
...attrs,
shape: floatButtonGroupContext?.shape.value || props.shape,
shape: floatButtonGroupContext?.shape.value || shape,
onClick: scrollToTop,
class: {
[`${prefixCls.value}`]: true,
[`${attrs.class}`]: attrs.class,
[`${prefixCls.value}-rtl`]: direction.value === 'rtl',
},
description,
type,
tooltip,
badge,
};
const transitionProps = getTransitionProps('fade');
@ -133,8 +132,7 @@ const BackTop = defineComponent({
<Transition {...transitionProps}>
<FloatButton v-show={state.visible} {...floatButtonProps} ref={domRef}>
{{
icon: () => <VerticalAlignTopOutlined />,
default: () => slots.default?.() || defaultElement,
icon: () => slots.icon?.() || <VerticalAlignTopOutlined />,
}}
</FloatButton>
</Transition>,

Loading…
Cancel
Save