Skip to content

Commit a94969d

Browse files
fix(Steps): prevent icon render for theme !== default (#3748)
* fix(Steps): prevent icon render for `theme !== default` * chore: update snapshot * fix(StepItem): 优化图标渲染逻辑 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent eb97c19 commit a94969d

File tree

3 files changed

+19
-138
lines changed

3 files changed

+19
-138
lines changed

packages/components/steps/StepItem.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,17 @@ const StepItem: React.FC<StepItemProps> = (originalProps) => {
2626

2727
// 步骤条每一步展示的图标
2828
const iconNode = React.useMemo<React.ReactNode>(() => {
29-
if (!icon) {
29+
if (!icon || theme !== 'default') {
3030
return null;
3131
}
3232

33-
if (theme === 'default' && icon !== true) {
33+
// 自定义图标直接返回
34+
if (icon !== true) {
3435
return icon;
3536
}
3637

3738
const iconCls = `${classPrefix}-steps-item__icon--number`;
3839

39-
if (icon !== true) {
40-
return <span className={iconCls}>{icon}</span>;
41-
}
42-
4340
// 根据状态返回对应的默认图标
4441
const getDefaultIconByStatus = () => {
4542
switch (status) {

0 commit comments

Comments
 (0)