//正则表达试
e.target.value = e.target.value.match(/^\d*(\.?\d{0,2})/g)[0] || null;
//重新赋值给input
this.$nextTick(() => {
this.num = e.target.value;
});
【uni-app】input框数字限制输入到小数点后两位
最新推荐文章于 2024-05-28 14:21:55 发布