微信小程序的 input 有个属性叫 type,这个 type 有几个可选值:
- text:不必解释
- number:数字键盘(无小数点)
- idcard:数字键盘(无小数点、有个 X 键)
- digit:数字键盘(有小数点)
注意:number 是无小数点的,digit 是有小数点的
<text class="lxr" decode>联系人</text>
<view class="lxrinput">
<input type="text" class="" name="lxr" bind="lxr" placeholder=""></input>
</view>
<text class="tel" decode>电话</text>
<view class="telinput">
<input type="number" class="" name="tel" bindblur="tel" placeholder=""></input>
</view>