当前位置:网站首页>El input limit can only input the specified number
El input limit can only input the specified number
2022-07-28 16:28:00 【Hi Mei】
1. el-input Limit can only enter positive integers
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"
Replacement code added to el-input in
<el-input
style="width:80px;"
@change="update(item)"
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"
v-model="item.quantity"
placeholder=" Please enter the purchase quantity "
></el-input>
2. el-input Only positive numbers and two decimal places can be entered
oninput="value= value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''"
Replacement code added to el-input in
<el-input
style="width:80px;"
oninput="value= value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''"
@change="update(item)"
v-model="item.freight"
placeholder=" Please enter the freight "
></el-input>
边栏推荐
猜你喜欢

Abaqus GUI界面解决中文乱码问题(插件中文乱码也适用)

Basic structure and operation principle of solar street lamp

c语言编程当中两个!!的作用

Redis系列4:高可用之Sentinel(哨兵模式)
![[Multisim Simulation] LM339 zero crossing circuit simulation](/img/ca/f6dae5fd298c00570407c2bdfa5118.png)
[Multisim Simulation] LM339 zero crossing circuit simulation

Zhengda cup hacker marathon data analysis competition

我在上海偶遇数字凤凰#坐标徐汇美罗城

Vm501 development kit development version single vibrating wire sensor acquisition module geotechnical engineering monitoring

疫情红利消失,「居家健身」泡沫消散

Leetcode topic
随机推荐
Why do most people who learn programming go to Shenzhen and Beijing?
ANSA二次开发 - Apps和ANSA插件管理
Writing of factorial
ANSA二次开发 - 抽中面的两种方法
curl无输出返回空白或者null问题解决
PHP图片合成技术
2021 Yahong pen test questions
I came across Digital Phoenix coordinate Xuhui Meiluo city in Shanghai
Qt学习之Qt Designer(设计师)
Zhaoqi science and technology innovation and entrepreneurship competition talent introduction platform, mass entrepreneurship and entrepreneurship competition high-level talent introduction
不懂就问,快速成为容器服务进阶玩家!
一大早支付宝来短信说你中“奖”了?处理服务器挖矿病毒 - kthreaddi
五舅的思考
食品安全 | 这两类瓜果宜改善便秘 孕妇人群尤其建议
Rosen's QT journey 101 models and views in QT quick
Instructions for mictr01 Tester development kit (vibrating wire acquisition reader)
Qt学习之安装
李宏毅《机器学习》丨5. Tips for neural network design(神经网络设计技巧)
Use js direct OSS to store files in Alibaba cloud and solve the limitation of large file upload server
自动打包压缩备份下载及删除 bat脚本命令