当前位置:网站首页>H5页面input输入框弹起数字键盘,需要支持小数点
H5页面input输入框弹起数字键盘,需要支持小数点
2022-07-25 14:24:00 【LILEILEILOVE】
<input :type='inputType' :pattern='inputPattern' v-model='inputValue'>
data(){
return {
inputType:"tel",
inputPattern:'[0-9.]*'
}
}
created(){
switch(this.getDeviceType()){
case:'android':
this.inputType = 'tel'
this.inputPattern = '[0-9.]*'
break;
case:"ios":
default:
this.inputType = "number"
this.inputPattern = "number"
break;
}
}
getDeviceType(){
const userAgent = navigator.userAgent.toLowerCase();
return (userAgent.indexOf('android')>-1 || userAgent.indexOf('Android')>-1)?'android':'ios'
}
//在pc端无法输入小数点。只保证移动设备可以
边栏推荐
- Apple failed to synchronize on its mobile terminal, so it exited the login. As a result, it could not log in again
- From fish eye to look around to multi task King bombing -- a review of Valeo's classic articles on visual depth estimation (from fisheyedistancenet to omnidet) (Part I)
- 元器件采购系统的主要功能,数字化采购助力元器件企业飞速发展
- Idea error failed to determine a suitable driver class
- Huawei ENSP router static route (the next hop address of the default route)
- Detailed explanation of nat/napt address translation (internal and external network communication) technology [Huawei ENSP]
- Nuc980 set up SSH xshell connection
- Jqgrid select all cancel single line click cancel event
- AI model risk assessment Part 1: motivation
- opencv视频跟踪「建议收藏」
猜你喜欢
知名手写笔记软件 招 CTO·坐标深圳

Mysql表的操作

Keys and scan based on redis delete keys with TTL -1

Resource not found: rgbd_launch 解决方案

关于ROS2安装connext RMW的进度条卡在13%问题的解决办法

Can the variable name be in Chinese? Directly fooled people

2271. Maximum number of white bricks covered by blanket ●●

基于PaddleOCR开发uni-app离线身份证识别插件

NUC980 设置SSH Xshell连接

Realsense-Ros安装配置介绍与问题解决
随机推荐
Okaleido生态核心权益OKA,尽在聚变Mining模式
科隆新能源IPO被终止:拟募资6亿 先进制造与战新基金是股东
jqgrid全选取消单行点击取消事件
Emergency science | put away this summer safety guide and let children spend the summer vacation safely!
NUC980 设置SSH Xshell连接
CDA level Ⅰ 2021 new version simulation question 2 (with answers)
网络安全应急响应技术实战指南(奇安信)
Idea settings ignore file configuration when submitting SVN
R语言如何将大型Excel文件转为dta格式详解
Doris learning notes integration with other systems
Interpretation of featdepth self-monitoring model for monocular depth estimation (Part 2) -- use of openmmlab framework
关于ROS2安装connext RMW的进度条卡在13%问题的解决办法
Jqgrid select all cancel single line click cancel event
From fish eye to look around to multi task King bombing -- a review of Valeo's classic articles on visual depth estimation (from fisheyedistancenet to omnidet) (Part 2)
thymeleaf通过样式控制display是否显示
实现一个家庭安防与环境监测系统(一)
The supply chain collaborative management system, a new "engine" of digitalization in machinery manufacturing industry, helps enterprises' refined management to a new level
thymeleaf设置disabled
Four methods of importing CSV text files into Excel
Flask SSTI injection learning