From f1bcf2093a29a3147df6c38d9155a02b2ff66b72 Mon Sep 17 00:00:00 2001 From: selicens <1244620067@qq.com> Date: Mon, 16 Oct 2023 14:21:39 +0800 Subject: [PATCH] fix(FloatButton): BackTop attribute invalid (#7009) * fix(FloatButton): BackTop attribute invalid * fix: attribute props * fix: Remove default slot --------- Co-authored-by: undefined --- components/float-button/BackTop.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/components/float-button/BackTop.tsx b/components/float-button/BackTop.tsx index 55e0b5466..6baa6daad 100644 --- a/components/float-button/BackTop.tsx +++ b/components/float-button/BackTop.tsx @@ -110,22 +110,21 @@ const BackTop = defineComponent({ }); const floatButtonGroupContext = useInjectFloatButtonGroupContext(); return () => { - const defaultElement = ( -
-
- -
-
- ); + 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({ {{ - icon: () => , - default: () => slots.default?.() || defaultElement, + icon: () => slots.icon?.() || , }} ,