Update vehicle.vue

This commit is contained in:
Sneha 2023-12-18 14:02:59 +05:30
parent aa69a2c782
commit bdf154b81a

View file

@ -225,6 +225,11 @@ export default {
watch: {
async selectedYear(year) {
this.makeOptions = [];
this.selectedMake = null;
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
if (year) {
const result = await this.getMakeOptions(year);
if (this.selectedYear == year) {
@ -236,15 +241,13 @@ export default {
this.carId = null;
}
}
} else {
this.makeOptions = [];
this.selectedMake = null;
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
},
async selectedMake(make) {
this.modelOptions = [];
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
if (make) {
const result = await this.getModelOptions(this.selectedYear, make);
if (this.selectedMake == make) {
@ -256,14 +259,12 @@ export default {
this.carId = null;
}
}
} else {
this.modelOptions = [];
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
},
async selectedModel(model) {
this.styleOptions = [];
this.selectedStyle = null;
this.carId = null;
if (model) {
const result = await this.getStyleOptions(
this.selectedYear,
@ -283,10 +284,6 @@ export default {
this.carId = null;
}
}
} else {
this.styleOptions = [];
this.selectedStyle = null;
this.carId = null;
}
},
async selectedStyle(style) {