From 4dd1a64949b088e1c162a8c3e5a4fa73deeaa9df Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 8 Oct 2023 20:11:52 +0800 Subject: [PATCH 1/3] fix(FloatButton): BackTop attribute invalid --- components/float-button/BackTop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/float-button/BackTop.tsx b/components/float-button/BackTop.tsx index 55e0b5466b..c979adb8d2 100644 --- a/components/float-button/BackTop.tsx +++ b/components/float-button/BackTop.tsx @@ -25,7 +25,6 @@ import { useInjectFloatButtonGroupContext } from './context'; const BackTop = defineComponent({ compatConfig: { MODE: 3 }, name: 'ABackTop', - inheritAttrs: false, props: initDefaultProps(backTopProps(), { visibilityHeight: 400, target: () => window, @@ -126,6 +125,7 @@ const BackTop = defineComponent({ [`${attrs.class}`]: attrs.class, [`${prefixCls.value}-rtl`]: direction.value === 'rtl', }, + type: props.type, }; const transitionProps = getTransitionProps('fade'); From e7627f1199672d22ed8e03d53125e52225bd167d Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 9 Oct 2023 14:01:18 +0800 Subject: [PATCH 2/3] fix: attribute props --- components/float-button/BackTop.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/components/float-button/BackTop.tsx b/components/float-button/BackTop.tsx index c979adb8d2..5fe1363573 100644 --- a/components/float-button/BackTop.tsx +++ b/components/float-button/BackTop.tsx @@ -25,6 +25,7 @@ import { useInjectFloatButtonGroupContext } from './context'; const BackTop = defineComponent({ compatConfig: { MODE: 3 }, name: 'ABackTop', + inheritAttrs: false, props: initDefaultProps(backTopProps(), { visibilityHeight: 400, target: () => window, @@ -109,23 +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', }, - type: props.type, + description, + type, + tooltip, + badge, }; const transitionProps = getTransitionProps('fade'); @@ -133,8 +132,7 @@ const BackTop = defineComponent({ {{ - icon: () => , - default: () => slots.default?.() || defaultElement, + icon: () => slots.default?.() || slots.icon?.() || , }} , From cc19e6467f9a7fc8f694ea28cc1ce7872b075dce Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 16 Oct 2023 13:36:26 +0800 Subject: [PATCH 3/3] fix: Remove default slot --- components/float-button/BackTop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/float-button/BackTop.tsx b/components/float-button/BackTop.tsx index 5fe1363573..6baa6daad4 100644 --- a/components/float-button/BackTop.tsx +++ b/components/float-button/BackTop.tsx @@ -132,7 +132,7 @@ const BackTop = defineComponent({ {{ - icon: () => slots.default?.() || slots.icon?.() || , + icon: () => slots.icon?.() || , }} ,