pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG] ProForm中valueType为money时, 输入框中的金额没有格式化, 小数点也没有显现

Open jaykou25 opened this issue 3 years ago • 3 comments
trafficstars

ProForm中valueType为money时, 输入框中的金额没有格式化, 小数点也没有显现

📷 复现步骤

https://codesandbox.io/s/schema-dependencies-forked-3vit1b?file=/App.tsx

jaykou25 avatar Aug 11 '22 09:08 jaykou25

可以在fieldProps中传入格式化函数(formatter,parser)实现金额格式化显示,可以参考一下这个: https://codesandbox.io/s/currency-wrapper-antd-input-3ynzo?file=/src/index.js

kiner-tang avatar Aug 13 '22 05:08 kiner-tang

恩,这样确实可以实现。但是money组件不就是要实现这部分的功能吗。我看源码里有用到formatter和parser

jaykou25 avatar Aug 13 '22 05:08 jaykou25

恩,这样确实可以实现。但是money组件不就是要实现这部分的功能吗。我看源码里有用到formatter和parser

看起来是内置的格式化正则表达式有问题

kiner-tang avatar Aug 13 '22 05:08 kiner-tang