学无先后,达者为师

网站首页 编程语言 正文

el-input当type=number时只能输入数字

作者:布偶乱跑 更新时间: 2022-04-10 编程语言

在使用element过程中,遇到了输入框需要加后缀,只能输正整数的需求,搜索后找到方法:

 <el-input  type="number"
            min="0"
            max="999999"
            onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
            v-model="value1">
    <template slot="append">.comtemplate>
 el-input>

原文链接:https://blog.csdn.net/weixin_44634372/article/details/113743335

栏目分类
最近更新