Skip to content

Commit 20dcdc5

Browse files
authored
Merge pull request #3216 from Brett-S-OWB/fix-soc-slider-battery-card
Koala - Add slot to pass battery SoC to child - SliderDouble
2 parents d2b4050 + 46753bb commit 20dcdc5

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

packages/modules/web_themes/koala/source/src/components/BatteryCard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@
6868
</q-card-section>
6969
<q-separator inset class="q-mt-sm" />
7070
<q-card-section>
71-
<SliderDouble :current-value="soc" :readonly="true" limit-mode="none" />
71+
<SliderDouble :current-value="soc" :readonly="true" limit-mode="none">
72+
<template #value> {{ soc }}% </template>
73+
</SliderDouble>
7274
</q-card-section>
7375
</q-card>
7476
<BatterySettingsDialog :battery-id="props.batteryId" ref="dialog" />

packages/modules/web_themes/koala/source/src/components/SliderDouble.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@
3737
<div class="col">
3838
<div>{{ props.limitMode == 'amount' ? 'Geladen' : 'Ladestand' }}</div>
3939
<div>
40-
{{
41-
props.limitMode === 'amount'
42-
? formatEnergy(props.currentValue)
43-
: !props.vehicleSocType
44-
? 'Kein SoC-Modul konfiguriert'
45-
: props.currentValue + '%'
46-
}}
40+
<slot name="value">
41+
{{
42+
props.limitMode === 'amount'
43+
? formatEnergy(props.currentValue)
44+
: !props.vehicleSocType
45+
? 'Kein SoC-Modul konfiguriert'
46+
: props.currentValue + '%'
47+
}}
48+
</slot>
4749
<q-icon
48-
v-if="props.vehicleSocType === 'manual' && props.limitMode !== 'amount'"
50+
v-if="
51+
props.vehicleSocType === 'manual' && props.limitMode !== 'amount'
52+
"
4953
name="edit"
5054
size="xs"
5155
class="q-ml-xs cursor-pointer"
@@ -54,7 +58,11 @@
5458
<q-tooltip>Ladestand eingeben</q-tooltip>
5559
</q-icon>
5660
<q-icon
57-
v-else-if="props.vehicleSocType && props.vehicleSocType !== 'manual' && props.limitMode !== 'amount'"
61+
v-else-if="
62+
props.vehicleSocType &&
63+
props.vehicleSocType !== 'manual' &&
64+
props.limitMode !== 'amount'
65+
"
5866
name="refresh"
5967
size="xs"
6068
class="q-ml-xs cursor-pointer"

0 commit comments

Comments
 (0)