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

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

vue中依然适用

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

猜你喜欢

转载自www.cnblogs.com/wangqiao170/p/9241985.html