<el-input onkeyup="this.value = this.value.replace(/[^\d.]/g,'');" maxlength="8" > 限制输入数字,且长度最大为8 </el-input> 八本那年博客,我们一直都在 如作者未注明既为原创文章,转载请注明本文链接及出处 ElementUI中input输入框限制只能输入数字 - https://www.barben.cn/code/674.html 喜欢 (11)