限制最大只能10位且小数点后两位
<vxe-column field="totalWeight" title="总毛重(g)">
<template #default="{ row, rowIndex }">
<el-input
oninput="value=value.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')"
maxlength="10"
placeholder="请输入"
v-model="row.totalWeight"
></el-input>
</template>
</vxe-column>


本文介绍了如何在Vue表单中使用Vxe-Table的columnfield元素,实现对totalWeight总毛重字段的输入限制,确保值不超过10位且小数点后只有两位。
1975

被折叠的 条评论
为什么被折叠?



