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

number输入框和input的number和float类型,能否加参数控制手动输入时是否自动补零 #65

Open
1 task done
zkzgs opened this issue Dec 21, 2024 · 6 comments
Labels
enhancement New feature or request realized This function has been implemented

Comments

@zkzgs
Copy link

zkzgs commented Dec 21, 2024

这个需求解决了什么问题:

https://vxeui.com/#/component/input/float
现在的float类型会自动在后面补零,期望加参数控制最大小数的同时且不自动补零
(能区分是否用户手动输入的0就更好了, 把抹零和补零区分开来)

建议的 API 是什么样的:

No response

是否已有其他不错的替代方案:

No response

是否使用当前最新版本?

  • 我已确认是使用当前的最新版本。
@zkzgs zkzgs added the enhancement New feature or request label Dec 21, 2024
@xuliangzhan xuliangzhan added the realized This function has been implemented label Dec 24, 2024
@xuliangzhan
Copy link
Collaborator

最新版本是优化输入的,聚焦时会自动去掉小数后无效0的

@zkzgs
Copy link
Author

zkzgs commented Dec 24, 2024

最新版本是优化输入的,聚焦时会自动去掉小数后无效0的

number-input-demo
image
与表格组合使用需要打磨下:

  1. 有默认值时第一次点击,小数点0没有去掉
  2. 失焦时会闪烁输入框后面的0
  3. 能给个参数把这0抹了吗,我只需要控制小数最大位数就可以了

@xlz26296
Copy link
Contributor

number 不就是没0 的吗,你用 float 就是固定小数

@zkzgs
Copy link
Author

zkzgs commented Dec 24, 2024

number 不就是没0 的吗,你用 float 就是固定小数

需要限制最大精度,这是我目前的解决方法
image
image
image

@zkzgs
Copy link
Author

zkzgs commented Dec 24, 2024

number 不就是没0 的吗,你用 float 就是固定小数

image
目的只是为了限制输入的最大小数位数

@xuliangzhan
Copy link
Collaborator

下版本支持 auto-fill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request realized This function has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants