保存
handleChange(e, record.key, col)"
:min="0"
:step="0.1"
:formatter="
(value) => {
let reg = /^(-)*(\d+)\.(\d).*$/;
return `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',').replace(reg, '$1$2.$3');
}
"
:parser="
(value) => {
let reg = /^(-)*(\d+)\.(\d).*$/;
return value.replace(/\s?|(,*)/g, '').replace(reg, '$1$2.$3');
}
"
/>
{{ text }}
handleChange(e, record.key, col)"
:min="0"
:step="1"
:autoFocus="true"
:formatter="
(value) => {
if (typeof value === 'string') {
return !isNaN(Number(value)) ? value.replace(/^(0+)|[^\d]/g, '') : '';
} else if (typeof value === 'number') {
return !isNaN(value) ? String(value).replace(/^(0+)|[^\d]/g, '') : '';
} else {
return '';
}
}
"
/>
{{ text }}