From dc9987aea8fb571d9a98255b904ad0bdc75c9a80 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Wed, 15 Feb 2023 14:34:11 +0800 Subject: [PATCH] fix: steps icon clss error --- components/steps/index.tsx | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/components/steps/index.tsx b/components/steps/index.tsx index fa12b9b48..6300eb1ba 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -17,7 +17,6 @@ import { booleanType, stringType, functionType, someType } from '../_util/type'; // CSSINJS import useStyle from './style'; -import { useToken } from '../theme/internal'; export const stepsProps = () => ({ prefixCls: String, @@ -30,11 +29,8 @@ export const stepsProps = () => ({ status: stringType<'wait' | 'process' | 'finish' | 'error'>(), size: stringType<'default' | 'small'>(), direction: stringType<'horizontal' | 'vertical'>(), - progressDot: someType( - [Boolean, Function], - undefined as boolean | ProgressDotRender, - ), - type: stringType<'default' | 'navigation'>(), + progressDot: someType([Boolean, Function]), + type: stringType<'default' | 'navigation' | 'inline'>(), onChange: functionType<(current: number) => void>(), 'onUpdate:current': functionType<(current: number) => void>(), }); @@ -67,9 +63,6 @@ const Steps = defineComponent({ setup(props, { attrs, slots, emit }) { const { prefixCls, direction: rtlDirection, configProvider } = useConfigInject('steps', props); - // 接入换肤 - const [, token] = useToken(); - // style const [wrapSSR, hashId] = useStyle(prefixCls); @@ -82,6 +75,8 @@ const Steps = defineComponent({ emit('update:current', current); emit('change', current); }; + const isInline = computed(() => props.type === 'inline'); + const mergedPercent = computed(() => (isInline.value ? undefined : props.percent)); const stepIconRender = ({ node, status, @@ -99,9 +94,8 @@ const Steps = defineComponent({
null} /> @@ -112,22 +106,23 @@ const Steps = defineComponent({ } return node; }; + const icons = computed(() => ({ + finish: , + error: , + })); return () => { const stepsClassName = classNames( { [`${prefixCls.value}-rtl`]: rtlDirection.value === 'rtl', - [`${prefixCls.value}-with-progress`]: props.percent !== undefined, + [`${prefixCls.value}-with-progress`]: mergedPercent.value !== undefined, }, attrs.class, hashId.value, ); - const icons = { - finish: , - error: , - }; + return wrapSSR(