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

[Input 输入框] type="number"时,如何控制小数精度,对Input原始属性step不支持 #1594

Closed
lnbiuc opened this issue Sep 19, 2024 · 4 comments · Fixed by #1602

Comments

@lnbiuc
Copy link

lnbiuc commented Sep 19, 2024

tdesign-mobile-vue 版本

1.4.2

重现链接

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step

重现步骤

No response

期望结果

No response

实际结果

No response

框架版本

3.5.3

浏览器版本

No response

系统版本

No response

Node版本

20

补充说明

是否可以通过这种方式实现控制小数位为两位呢

感谢各位大佬对开源的贡献,感谢各位大佬帮助

Copy link
Contributor

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

@anlyyao
Copy link
Collaborator

anlyyao commented Sep 24, 2024

@lnbiuc 方便提供下具体使用场景吗~。 原生 step 属性貌似也不能直接控制精度

@lnbiuc
Copy link
Author

lnbiuc commented Sep 25, 2024

@lnbiuc 方便提供下具体使用场景吗~。 原生 step 属性貌似也不能直接控制精度

感谢大佬回复!

输入金额的时候,需要控制只显示两位或四位小数

我注意到input有提供一个format props,也可以实现控制小数位数,但是我尝试了输入值的时候没有调用传入的func,是因为还在开发中吗

@anlyyao
Copy link
Collaborator

anlyyao commented Sep 25, 2024

@lnbiuc 方便提供下具体使用场景吗~。 原生 step 属性貌似也不能直接控制精度

感谢大佬回复!

输入金额的时候,需要控制只显示两位或四位小数

我注意到input有提供一个format props,也可以实现控制小数位数,但是我尝试了输入值的时候没有调用传入的func,是因为还在开发中吗

这个API确实还没实现,我补齐一下,预计本周发版可带

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants