fix(input-number): fix the issuse of missing id when use in form (#6519)

closed #6466
pull/6524/head
Zhan Dong 2023-05-03 13:28:47 +08:00 committed by GitHub
parent b39f2b2d03
commit 3b37cc1ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -76,6 +76,7 @@ const InputNumber = defineComponent({
emit('focus', e);
};
return () => {
const id = props.id ?? formItemContext.id.value;
const {
class: className,
bordered,
@ -86,7 +87,7 @@ const InputNumber = defineComponent({
prefix = slots.prefix?.(),
valueModifiers = {},
...others
} = { ...attrs, ...props } as InputNumberProps & HTMLAttributes;
} = { ...attrs, ...props, id } as InputNumberProps & HTMLAttributes;
const preCls = prefixCls.value;