当前位置:网站首页>Method to limit the input box to only numbers

Method to limit the input box to only numbers

2022-06-12 08:40:00 Pumpkin_ xiaoXuan

<el-form-item label=" Default cost price ">

    <el-input v-model="costPrice" placeholder=" Please enter the default cost price of the product " type="number"

        onkeypress="return(/[\d.]/.test(String.fromCharCode(event.keyCode)))" clearable />

</el-form-item>

  Add this sentence , You can make the input box only input numbers οnkeypress="return(/[\d.]/.test(String.fromCharCode(event.keyCode)))"

原网站

版权声明
本文为[Pumpkin_ xiaoXuan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203010547586586.html