二手车交易,售价输入0开头时,后边不允许输入任何数字
This commit is contained in:
@ -272,10 +272,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
validatePrice(value) {
|
validatePrice(value) {
|
||||||
if (/^0+$/.test(value)){
|
if (value?.startsWith(0) && value?.length > 1) {
|
||||||
value = '0';
|
this.$nextTick(() => {
|
||||||
|
this.form.minPrice = 0
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.form.minPrice = value;
|
|
||||||
},
|
},
|
||||||
clearStorageFormInfo(){
|
clearStorageFormInfo(){
|
||||||
localStorage.setItem("carSourceFormInfo",'')
|
localStorage.setItem("carSourceFormInfo",'')
|
||||||
|
@ -173,16 +173,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
validatePrice(value) {
|
validatePrice(value) {
|
||||||
if (/^0+$/.test(value)){
|
if (value?.startsWith(0) && value?.length > 1) {
|
||||||
value = '0';
|
this.$nextTick(() => {
|
||||||
|
this.form.minPrice = 0
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.form.minPrice = value;
|
|
||||||
},
|
},
|
||||||
validatePrice1(value) {
|
validatePrice1(value) {
|
||||||
if (/^0+$/.test(value)){
|
if (value?.startsWith(0) && value?.length > 1) {
|
||||||
value = '0';
|
this.$nextTick(() => {
|
||||||
|
this.form.maxPrice = 0
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.form.maxPrice = value;
|
|
||||||
},
|
},
|
||||||
clearStorageFormInfo(){
|
clearStorageFormInfo(){
|
||||||
localStorage.setItem("wantBuyFormInfo",'')
|
localStorage.setItem("wantBuyFormInfo",'')
|
||||||
|
Reference in New Issue
Block a user