Updated forms and some UI for new data structure

This commit is contained in:
Stefan Zermatten
2021-09-28 14:25:11 +02:00
parent b471d0c5cf
commit cb10b53a10
52 changed files with 304 additions and 301 deletions

View File

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