mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 05:18:10 +00:00
Fix błędu z wyborem ładunków
This commit is contained in:
@@ -70,8 +70,8 @@
|
|||||||
data-select="cargo"
|
data-select="cargo"
|
||||||
data-ignore-outside="1"
|
data-ignore-outside="1"
|
||||||
v-model="store.chosenCargo"
|
v-model="store.chosenCargo"
|
||||||
@focus="onVehicleSelect('car')"
|
@focus="onVehicleSelect('cargo')"
|
||||||
@change="onVehicleSelect('car')"
|
@change="onVehicleSelect('cargo')"
|
||||||
@keydown.enter.prevent="addOrSwitchVehicle"
|
@keydown.enter.prevent="addOrSwitchVehicle"
|
||||||
@keydown.backspace="removeVehicle"
|
@keydown.backspace="removeVehicle"
|
||||||
>
|
>
|
||||||
@@ -199,11 +199,14 @@ export default defineComponent({
|
|||||||
this.store.swapVehicles = true;
|
this.store.swapVehicles = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
onVehicleSelect(type: 'loco' | 'car') {
|
onVehicleSelect(type: 'loco' | 'car' | 'cargo') {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (!this.store.chosenLoco && !this.store.chosenCar) return;
|
if (!this.store.chosenLoco && !this.store.chosenCar) return;
|
||||||
|
|
||||||
this.store.chosenVehicle = type == 'loco' ? this.store.chosenLoco : this.store.chosenCar;
|
this.store.chosenVehicle = type == 'loco' ? this.store.chosenLoco : this.store.chosenCar;
|
||||||
|
|
||||||
|
this.store.chosenCargo =
|
||||||
|
this.store.chosenCar?.cargoList.find((cargo) => cargo.id == this.store.chosenCargo?.id) || null;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -362,3 +365,4 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export default defineComponent({
|
|||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
|
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
height: 290px;
|
height: 20em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.train-image {
|
.train-image {
|
||||||
|
|||||||
Reference in New Issue
Block a user