Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputNumber 数字输入框 #4833

Open
JHeLiu opened this issue Dec 12, 2024 · 2 comments
Open

InputNumber 数字输入框 #4833

JHeLiu opened this issue Dec 12, 2024 · 2 comments
Labels
💭 discussion we are discussing usage the issue about component usage

Comments

@JHeLiu
Copy link

JHeLiu commented Dec 12, 2024

这个功能解决了什么问题

输入为 值类型的时候 ,如果不输入,输入框为空的时候,会破坏数据结构 ,会强制把 值类型转换成了 undefined,影响后续转换以及业务判断

假设有一个值类型 quantity: number = 0; 我设置了 min 以及 max ,但是不输入任何值的时候,它会破坏原本的数据值

你建议的方案是什么

希望添加一个参数例如 bool 类型来控制,如果true 情况下 ,如果输入框是空值,则选择默认值

emptyAsdefaultValue

<t-input-number :emptyAsdefaultValue="true" :defaultValue="1" />

Copy link
Contributor

👋 @JHeLiu,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@uyarn
Copy link
Collaborator

uyarn commented Dec 30, 2024

这个场景可以用受控方式来处理 在onchange回调中决定value绑定的ref的值如何变化

@uyarn uyarn added usage the issue about component usage 💭 discussion we are discussing labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💭 discussion we are discussing usage the issue about component usage
Projects
None yet
Development

No branches or pull requests

2 participants