1. 只允许输入数字,并保留两位小数
<el-input class="config-input" type="number" v-model="v.minHeight" placeholder="" :min="0" @input="v.minHeight = Number(Number(v.minHeight).toFixed(2))" /
2. 只允许输入数字,不可以有小数
<el-input class="self-area-input" type="number" v-model="selfMixtureArea.self1Times" placeholder="" :min="0" @input="selfMixtureArea.self1Times = Number(selfMixtureArea.self1Times.toString().replace(/[^\d]/g, ''))" />
标签:el,格式化,数字,input,输入,小数 From: https://www.cnblogs.com/cai-hua/p/17859258.html