Feat: use output function for month description

This commit is contained in:
Bertrand Benjamin 2021-08-13 09:43:47 +02:00
parent 710015a37b
commit 9cf4cf934b
2 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,7 @@
<ul v-show="!editing"> <ul v-show="!editing">
<li v-for="cara in monthDesc" :key='cara.name'> <li v-for="cara in monthDesc" :key='cara.name'>
<label :for='cara.name'>{{ cara.desc }}</label> <label :for='cara.name'>{{ cara.desc }}</label>
<span class="value" >{{ TheMonth.[cara.name] ?? "∅"}} {{cara.unit}}</span> <span class="value" >{{ cara.output(TheMonth) ?? "∅"}} {{cara.unit}}</span>
</li> </li>
</ul> </ul>
<ul v-show="editing"> <ul v-show="editing">
@ -26,7 +26,6 @@
<input type="number" v-model.number="monthCopy[cara.name]" id="cara.name" class="value"> <input type="number" v-model.number="monthCopy[cara.name]" id="cara.name" class="value">
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</template> </template>

View File

@ -18,6 +18,7 @@ const config = {
name: 'caTheo', name: 'caTheo',
unit: '€', unit: '€',
hightlight: true, hightlight: true,
output: month => month.caTheo,
}, },
{ {
color: '', color: '',
@ -26,6 +27,7 @@ const config = {
name: 'caRetro', name: 'caRetro',
unit: '€', unit: '€',
hightlight: false, hightlight: false,
output: month => month.caRetro,
}, },
{ {
color: '', color: '',
@ -34,6 +36,7 @@ const config = {
name: 'caReact', name: 'caReact',
unit: '€', unit: '€',
hightlight: true, hightlight: true,
output: month => month.caReact,
}, },
{ {
color: '', color: '',
@ -42,6 +45,7 @@ const config = {
name: 'sessionQty', name: 'sessionQty',
unit: '', unit: '',
hightlight: false, hightlight: false,
output: month => month.sessionQty,
}, },
{ {
color: '', color: '',
@ -50,6 +54,7 @@ const config = {
name: 'retro', name: 'retro',
unit: '€', unit: '€',
hightlight: false, hightlight: false,
output: month => month.retro,
}, },
{ {
color: '', color: '',
@ -58,6 +63,7 @@ const config = {
name: 'remuneration', name: 'remuneration',
unit: '€', unit: '€',
hightlight: true, hightlight: true,
output: month => month.remuneration,
}, },
{ {
color: '', color: '',
@ -66,6 +72,7 @@ const config = {
name: 'proPercentage', name: 'proPercentage',
unit: '%', unit: '%',
hightlight: false, hightlight: false,
output: month => month.proPercentage,
}, },
], ],
} }