console
<script>
export default {
data() {
return {
integralDeduction: '',
points: 0
}
},
methods: {
onKeyInput(event: any) {
this.integralDeduction = event.detail.value.replace(/\b(0+)/gi,"");
if (Number(event.target.value) > this.points) {
this.integralDeduction = this.points || "";
} else if (Number(event.target.value) < 0) {
this.integralDeduction = "";
}
return this.integralDeduction;
},
}
}
</script>
<template>
<input
type="number"
:value="integralDeduction"
placeholder="请输入积分"
placeholder-style="color:#c9c9c9"
@input="onKeyInput"
/>
</template>