mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-04 12:08:12 +00:00
chore: replaced footer version check with vehicle counters
This commit is contained in:
@@ -9,7 +9,13 @@
|
||||
</i18n-t>
|
||||
|
||||
<div class="text--grayed" v-if="store.vehiclesData">
|
||||
{{ $t('footer.version-check', { version: store.compatibleSimulatorVersion }) }}
|
||||
{{
|
||||
$t('footer.vehicles-count', {
|
||||
all: vehiclesCounters.all,
|
||||
units: vehiclesCounters.units,
|
||||
cars: vehiclesCounters.cars,
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -33,6 +39,27 @@ export default defineComponent({
|
||||
store: useStore(),
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
vehiclesCounters() {
|
||||
let counters = {
|
||||
all: 0,
|
||||
cars: 0,
|
||||
units: 0,
|
||||
};
|
||||
|
||||
if (!this.store.vehiclesData) return counters;
|
||||
|
||||
this.store.vehiclesData?.forEach((v) => {
|
||||
counters.all += 1;
|
||||
|
||||
if (v.group.locoProps !== null) counters.units += 1;
|
||||
else counters.cars += 1;
|
||||
});
|
||||
|
||||
return counters;
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user