Fixed attributes not showing base value in lib

This commit is contained in:
Stefan Zermatten
2022-11-19 19:35:46 +02:00
parent f3deadb3f1
commit cc7dc257fb

View File

@@ -7,21 +7,31 @@
justify-sm="start"
>
<property-field
v-if="model.value !== undefined ||
fallbackValue !== undefined"
:name="model.damage !== undefined ? 'Value / Total': 'Value'"
center
>
<v-spacer />
<div
class="text-h4 mr-3"
>
<div class="mr-3">
<div
v-if="model.damage !== undefined"
class="text-h4 mr-3"
>
{{ model.value }} / {{ model.total }}
</div>
<div v-else>
<div
v-if="model.value !== undefined"
class="text-h4 mr-3"
>
{{ model.value }}
</div>
<div
v-else
class="mono"
>
{{ fallbackValue }}
</div>
</div>
<v-spacer />
<increment-button
@@ -181,6 +191,9 @@
effects() {
return sortEffects(this.model.effects);
},
fallbackValue() {
return this.model.baseValue?.value ?? this.model.baseValue?.calculation;
},
},
methods: {
numberToSignedString,
@@ -222,4 +235,7 @@
.attribute-value {
text-align: center;
}
.mono {
font-family: monospace !important;
}
</style>