微信小程序的 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>
最后
以上就是搞怪鼠标最近收集整理的关于小程序中输入框input的type属性 text、number、idcard、digit 区别的全部内容,更多相关小程序中输入框input的type属性内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复