The Ele.me input box is limited to numbers and decimals are retained.

You can use the input-number component in Ele.me UI to realize that the input box can only enter numbers, so that you cannot enter other than numbers. Controls hide the plus and minus buttons on the left and right sides of the input box. Precision retains the number of decimal places. 2 means two bit, but it will result in the default value being 0.00. There are two solutions:

<el-input-number v-model="setForm.prize" :precision="2" :controls='false' placeholder="请输入保证金"></el-input-number>

First: The fields in v-model are deleted by default. Because of the responsive nature of vue, it doesn’t matter if you delete them. If the value is changed or the edit is echoed, the fields will be added automatically. Second method: Set the min attribute for the input box, and set
min An empty string for '' can also solve this problem

<el-input-number v-model="setForm.prize" :precision="2" min="''" :controls='false' placeholder="请输入保证金"></el-input-number>

Guess you like

Origin blog.csdn.net/xiaokangna/article/details/132139193