Skip to content

Commit e9d0600

Browse files
committed
fix(input): prefix don't render when value is str
1 parent 5279d12 commit e9d0600

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/input/Input.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ export default defineComponent({
129129
{hasFeedback && feedbackIcon}
130130
</>
131131
);
132+
const prefixNode = (hasFeedback || prefix) && (
133+
<>
134+
{prefix}
135+
{hasFeedback && feedbackIcon}
136+
</>
137+
);
132138
const prefixClsValue = prefixCls.value;
133139
const inputHasPrefixSuffix = hasPrefixSuffix({ prefix, suffix }) || !!hasFeedback;
134140
const clearIcon = slots.clearIcon || (() => <CloseCircleFilled />);
@@ -144,6 +150,7 @@ export default defineComponent({
144150
autocomplete={autocomplete.value}
145151
onBlur={handleBlur}
146152
onFocus={handleFocus}
153+
prefix={prefixNode}
147154
suffix={suffixNode}
148155
allowClear={allowClear}
149156
addonAfter={

0 commit comments

Comments
 (0)