From bdf154b81ac1b2675edc1f40c6cb15b9f318877a Mon Sep 17 00:00:00 2001 From: Sneha Date: Mon, 18 Dec 2023 14:02:59 +0530 Subject: [PATCH] Update vehicle.vue --- src/layouts/vehicle/vehicle.vue | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index bba7b89b8..1292983f1 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -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) {