VUE项目中数字输入框调用手机数字键盘

2019-10-15  本文已影响0人  葡萄Ccz

<input  type="number" min="0" inputmode="numeric" pattern="[0-9]*" placeholder="50-130" >

以上安卓手机键盘显示数字【0-9】和小数点;

苹果手机是数字和标点;

问题:type为“number”后,无法用 maxlength属性控制输入的位数;

<input type="text" min="0" inputmode="numeric" pattern="[0-9]*" placeholder="20-130" maxlength="11">

以上安卓手机键盘是显示纯数字无小数点;

苹果手机依然显示为数字和标点;

上一篇 下一篇

猜你喜欢

热点阅读