I had some problems writing code today ,input of type Attribute value is number Hour ,maxlength The setting of will be invalid ,type Attribute value is text Hour , Can't satisfy input
Limit of number only , The solutions found are as follows :

1, Only numbers and decimal points can be entered
@keyup="val.num = val.num.replace(/[^\d.]/g,'')"
concrete content :
<form v-for="(val,index) in list" :key='val.id'> <input type = "text"
placeholder = " Please enter quantity " v-model = "val.num" maxlength = "7" @keyup = "val.num =
val.num.replace(/[^\d.]/g,'')" /> </form>
2, Only one decimal point can be entered , When the second is not '.' Hour , First cannot be 0

2.1 Limit one decimal point
val.num= val.num .toString().//replace() Method is a string method .replace(/\.{2,}/g,'.') .
replace('.','$#$') .replace(/\./g,'') .replace('$#$','.')// Only one decimal point can be entered
2.2 First cannot be 0
if(val.num.length > 1 && val.num.substr(0,1) ==0 && val.num.substr(1,1) !='.'){
val.num= val.num.substr(1,1) }
2.3, The first is not a point
Method 1 :
if(val.num.substr(0,1) == '.'){ val.num="" }
Method II :
if(val.num.indexOf(".") <= 0 && val.num!= ''){ val.num= parseFloat(val.num) }
2.4, Limit the number of decimal places (3 Bit as an example )
val.num= val.num .toString() .replace(/^()*(\d+)\.(\.?\d\d\d).*$/,'$2$2.$3')
//d There are several decimal places

Technology
©2019-2020 Toolsou All rights reserved,
Dynamic Simple registration login interface HTML+CSS+JQCSS Implement overflow display ellipsis 802.11 CCA and NAV mechanism Programmer refused due to low salary offer,HR become shame , Netizens instantly blew up ..abaqus Value of mass scaling factor _ABAQUS Mass scaling for Java Student information management system console version C Classic topics of language —— Insert a number into the sorted array Computer level 1 multi-point , How many points can I pass the computer test level 1 VINS-Fusion run kitti stereo and stereo+GPS data TS stay vue2 Writing in the project