Improved Attribute damage viewer

This commit is contained in:
Stefan Zermatten
2021-02-23 13:59:26 +02:00
parent aad0c7249e
commit f2883d320f
2 changed files with 79 additions and 4 deletions

View File

@@ -10,7 +10,11 @@
<div
class="text-no-wrap text-truncate"
>
{{ model.amountResult }} {{ model.stat }} damage
<span v-if="model.amountResult < 0">+</span>
{{ absoluteAmount }} {{ model.stat }}
<span v-if="typeof absoluteAmount === 'string' || absoluteAmount >= 0">
damage
</span>
</div>
</div>
</template>
@@ -20,5 +24,14 @@ import treeNodeViewMixin from '/imports/ui/properties/treeNodeViews/treeNodeView
export default {
mixins: [treeNodeViewMixin],
computed: {
absoluteAmount(){
if (typeof this.model.amountResult === 'number'){
return Math.abs(this.model.amountResult);
} else {
return this.model.amountResult;
}
},
}
}
</script>