二手车交易,售价输入0开头时,后边不允许输入任何数字

This commit is contained in:
2025-03-25 14:15:57 +08:00
parent fc4cbbed7a
commit 321414ad87
2 changed files with 12 additions and 9 deletions

View File

@ -272,10 +272,11 @@ export default {
},
methods:{
validatePrice(value) {
if (/^0+$/.test(value)){
value = '0';
if (value?.startsWith(0) && value?.length > 1) {
this.$nextTick(() => {
this.form.minPrice = 0
})
}
this.form.minPrice = value;
},
clearStorageFormInfo(){
localStorage.setItem("carSourceFormInfo",'')

View File

@ -173,16 +173,18 @@ export default {
},
methods:{
validatePrice(value) {
if (/^0+$/.test(value)){
value = '0';
if (value?.startsWith(0) && value?.length > 1) {
this.$nextTick(() => {
this.form.minPrice = 0
})
}
this.form.minPrice = value;
},
validatePrice1(value) {
if (/^0+$/.test(value)){
value = '0';
if (value?.startsWith(0) && value?.length > 1) {
this.$nextTick(() => {
this.form.maxPrice = 0
})
}
this.form.maxPrice = value;
},
clearStorageFormInfo(){
localStorage.setItem("wantBuyFormInfo",'')