Skip to content

Commit da8e70e

Browse files
authored
fix(button): 修复图标显示条件判断逻辑 (#953)
1 parent 6ff083a commit da8e70e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/button/button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export default defineComponent({
114114
? (
115115
<LoadingOutlined class={loadingIconClassName} />
116116
)
117-
: props.iconPlacement !== 'right' && <span class={`${prefixCls}-icon`}>{slots.icon?.()}</span> }
117+
: (props.iconPlacement !== 'right' && slots.icon) && <span class={`${prefixCls}-icon`}>{slots.icon?.()}</span> }
118118
{slots.default?.()}
119-
{props.iconPlacement === 'right' && <span class={[`${prefixCls}-icon`, 'is-right']}>{slots.icon?.()}</span> }
119+
{(props.iconPlacement === 'right' && slots.icon) && <span class={[`${prefixCls}-icon`, 'is-right']}>{slots.icon?.()}</span> }
120120
</button>
121121
);
122122
},

0 commit comments

Comments
 (0)