input type='number'时,maxlength属性无效

it2022-05-09  57

<input type="number" οninput="if(value.length>11)value=value.slice(0,11)" />

vue中依然适用

<el-input type="number" v-model="ruleForm.tourTelphone" placeholder="请填写电话号码" οninput="if(value.length>20)value=value.slice(0,20)"></el-input>   希望本文对你有所帮助!

 

转载于:https://www.cnblogs.com/wangqiao170/p/9241985.html


最新回复(0)