Skip to content

Commit 3b37cc1

Browse files
authored
fix(input-number): fix the issuse of missing id when use in form (#6519)
closed #6466
1 parent b39f2b2 commit 3b37cc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/input-number/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const InputNumber = defineComponent({
7676
emit('focus', e);
7777
};
7878
return () => {
79+
const id = props.id ?? formItemContext.id.value;
7980
const {
8081
class: className,
8182
bordered,
@@ -86,7 +87,7 @@ const InputNumber = defineComponent({
8687
prefix = slots.prefix?.(),
8788
valueModifiers = {},
8889
...others
89-
} = { ...attrs, ...props } as InputNumberProps & HTMLAttributes;
90+
} = { ...attrs, ...props, id } as InputNumberProps & HTMLAttributes;
9091

9192
const preCls = prefixCls.value;
9293

0 commit comments

Comments
 (0)