问题 input输入框type设置为number,maxlength无效 解决方案: 添加oninput <input type="number" oninput="if(value.length>10)value=value.slice(0,10)" />