<el-input type="number" v-model.number="timeLimitOurse" @input="handerInput"></el-input>
// 判断自定义输入事件
handerInput() {
// 判断不能输入小数点
let str = '' + this.timeLimitOurse;
if (str.indexOf('.') !== -1) {
let arr = str.split('');
arr.splice(arr.length - 1);
let str2 = arr.join('');
this.timeLimitOurse = +str2;
}
},
vue 不能输入小数点
最新推荐文章于 2025-07-07 13:46:31 发布
4941

被折叠的 条评论
为什么被折叠?



