1、precision 属性是支持的,失焦后或者Enterup会生效,但是无法在光标输入期间限制住
<a-input-number :precision="2" v-model:value="formState.amount"
placeholder="Min 1000"
:controls="false"
:formatter="
(value) =>
value
.toString()
.replace(/(?!\.)(\D)/g, '')
.replace(/^(\d*\.\d{0,2}).*$/g, '$1')
.replace(value.toString().indexOf('.') > -1 ? /\B(?=(\d{3})+(?!\d)+\.)/g : /\B(?=(\d{3})+(?!\d))/g, ',')
.replace(/^(\w*\.\d{0,2}).*$/g, '$1')
"
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
>