当前位置:网站首页>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端无法输入小数点。只保证移动设备可以
边栏推荐
- ~4.2 CCF 2021-12-1 sequence query
- Cologne new energy IPO was terminated: the advanced manufacturing and Zhanxin fund to be raised is the shareholder
- 基于redis的keys、scan删除ttl为-1的key
- Products on Apple's official website can save 600 yuan by buying iPhone 13 Pro max at a discount
- Numpy basic package for data analysis
- OKA通证权益解析,参与Okaleido生态建设的不二之选
- DVWA practice - brute force cracking
- Application practice: Great integrator of the paddy classification model [paddlehub, finetune, prompt]
- [learning record] plt.show() solution to flash back
- Goldfish rhca memoirs: cl210 managing storage -- managing shared file systems
猜你喜欢

Melodic + Realsense D435i 配置及错误问题解决

sqli-labs Basic Challenges Less11-22

安防市场进入万亿时代,安防B2B网上商城平台精准对接深化企业发展路径

51单片机学习笔记(2)

Okaleido ecological core equity Oka, all in fusion mining mode

The security market has entered a trillion era, and the security B2B online mall platform has been accurately connected to deepen the enterprise development path

疫情之下,生物医药行业或将迎来突破性发展

~4.1 sword finger offer 05. replace spaces

为什么中建、中铁都需要这本证书?究竟是什么原因?

Mongodb source code deployment and configuration
随机推荐
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster
OKA通证权益解析,参与Okaleido生态建设的不二之选
CTS test introduction (how to introduce interface test in interview)
Cologne new energy IPO was terminated: the advanced manufacturing and Zhanxin fund to be raised is the shareholder
Doris learning notes integration with other systems
Word set paste to retain only text
telnet远程登录aaa模式详解【华为eNSP】
依迅总经理孙峰:公司已完成股改,准备IPO
Pytorch uses tensorboard to realize visual summary
Matplotlib data visualization three minutes entry, half an hour enchanted?
Resource not found: rgbd_launch 解决方案
Huawei ENSP router static route (the next hop address of the default route)
IDEA设置提交SVN时忽略文件配置
NAT/NAPT地址转换(内外网通信)技术详解【华为eNSP】
maya建模练习
Emergency science | put away this summer safety guide and let children spend the summer vacation safely!
Initial flask and simple application
Throwing OutOfMemoryError “Could not allocate JNI Env“
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)
Deep understanding of pytorch distributed parallel processing tool DDP -- starting from bugs in engineering practice