<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>
希望本文對你有所幫助!