Skip to content

Commit 837ddf4

Browse files
committed
Formatting, expansion specs
1 parent 2994998 commit 837ddf4

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/components/MobileBatteryCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const b = props.battery
1616
<div class="mobile-card surface">
1717
<div class="mobile-card-header">
1818
<router-link :to="`/batterij/${b.manufacturerSlug}/${b.modelSlug}`" class="mobile-title">
19-
<template v-if="showManufacturer">{{ b.manufacturer }} </template>{{ b.model }}
19+
<template v-if="showManufacturer">{{ b.manufacturer }}</template> {{ b.model }}
2020
</router-link>
2121
<label class="compare-check">
2222
<input type="checkbox" :checked="isSelected(b.id)" @change="toggle(b.id)" />

src/models/BatteryModel.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ export class BatteryModel {
155155
return (maxKwh && this.data.expansion) ? `${maxKwh.toLocaleString('nl-NL')} kWh` : '-'
156156
}
157157

158+
get expansionDimensions(): string {
159+
const p = this.data.expansion?.expansionPhysical
160+
if (!p?.widthMm && !p?.heightMm && !p?.depthMm) return '-'
161+
return `${mmToCm(p.widthMm)} \u00d7 ${mmToCm(p.heightMm)} \u00d7 ${mmToCm(p.depthMm)} cm`
162+
}
163+
164+
get expansionWeightKg(): string { return unitDash(this.data.expansion?.expansionPhysical?.weightKg, 'kg') }
165+
158166
/* Connectivity */
159167
get supportedP1Meters(): P1MeterRef[] { return this.data.supportedP1Meters ?? [] }
160168
get p1Meter(): string {

src/views/BatteryDetailView.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ if (typeof document !== 'undefined') {
120120
<dt>Max. totaalcapaciteit</dt>
121121
<dd>{{ battery.expansionMaxCapacity }}</dd>
122122
</div>
123+
<div class="spec-item">
124+
<dt>Afmetingen (B x H x D)</dt>
125+
<dd>{{ battery.expansionDimensions }}</dd>
126+
</div>
127+
<div class="spec-item">
128+
<dt>Gewicht</dt>
129+
<dd>{{ battery.expansionWeightKg }}</dd>
130+
</div>
123131
</dl>
124132
</section>
125133

0 commit comments

Comments
 (0)