<el-input
class="ipt"
onkeyup="this.value=this.value.replace(/[^[0-9]/g,'').replace(/^0[0-9]*/g, '')"
onafterpaste="this.value=this.value.replace(/[^[0-9]/g,'').replace(/^0[0-9]*/g, '')"
v-model="i.time"
></el-input>
发现了更简单的写法
@input="this.minText = this.minText.replace(/^(0+)|[^\d]+/g, '')"
11-03
2855
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-26