Skip to content

The props attribute value of a-input-number is of type ValueType is string | number. A null should be added. #8297

@cieme

Description

@cieme
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

undefined

Environment

window10 vue@latest chrome@latest [email protected]

Reproduction link

https://github.com/

Steps to reproduce

const value = ref<null | number>(null)

Type 'number | null' is not assignable to type 'ValueType | undefined'.
Type 'null' is not assignable to type 'ValueType | undefined'.

What is expected?

The props attribute value of a-input-number is of type ValueType is string | number. A null should be added.
期望类型增加 null ,因为 backsapce or delete 删除后 value is null ,但是他不在类型之内,会导致ts 报错

What is actually happening?

a-input-number value 的当前类型为 string | number ,但是 当你点击 backsapce or delete 清空输入框,他的有效值为 null,所以应该增加一个 null 类型, 但是他不在类型之内,会导致ts 报错

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions