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
parent
398710cf1b
commit
f1bcf2093a
|
@ -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…
Reference in New Issue