Skip to content

Commit f1bcf20

Browse files
authored
fix(FloatButton): BackTop attribute invalid (#7009)
* fix(FloatButton): BackTop attribute invalid * fix: attribute props * fix: Remove default slot --------- Co-authored-by: undefined <undefined>
1 parent 398710c commit f1bcf20

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Diff for: components/float-button/BackTop.tsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -110,31 +110,29 @@ const BackTop = defineComponent({
110110
});
111111
const floatButtonGroupContext = useInjectFloatButtonGroupContext();
112112
return () => {
113-
const defaultElement = (
114-
<div class={`${prefixCls.value}-content`}>
115-
<div class={`${prefixCls.value}-icon`}>
116-
<VerticalAlignTopOutlined />
117-
</div>
118-
</div>
119-
);
113+
const { description, type, shape, tooltip, badge } = props;
114+
120115
const floatButtonProps = {
121116
...attrs,
122-
shape: floatButtonGroupContext?.shape.value || props.shape,
117+
shape: floatButtonGroupContext?.shape.value || shape,
123118
onClick: scrollToTop,
124119
class: {
125120
[`${prefixCls.value}`]: true,
126121
[`${attrs.class}`]: attrs.class,
127122
[`${prefixCls.value}-rtl`]: direction.value === 'rtl',
128123
},
124+
description,
125+
type,
126+
tooltip,
127+
badge,
129128
};
130129

131130
const transitionProps = getTransitionProps('fade');
132131
return wrapSSR(
133132
<Transition {...transitionProps}>
134133
<FloatButton v-show={state.visible} {...floatButtonProps} ref={domRef}>
135134
{{
136-
icon: () => <VerticalAlignTopOutlined />,
137-
default: () => slots.default?.() || defaultElement,
135+
icon: () => slots.icon?.() || <VerticalAlignTopOutlined />,
138136
}}
139137
</FloatButton>
140138
</Transition>,

0 commit comments

Comments
 (0)