vue_activity: adapt bloc width, depends of blocs number

This commit is contained in:
Mathieu Jaumotte 2021-11-25 11:41:44 +01:00
parent 92753604fa
commit b09f32b1c2
3 changed files with 7 additions and 5 deletions

View File

@ -6,6 +6,7 @@
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:blocWidth="getBlocWidth"
v-bind:setPersonsInBloc="setPersonsInBloc">
</persons-bloc>
</div>
@ -122,6 +123,9 @@ export default {
}
}
},
getBlocWidth() {
return Math.round(100/(this.contextPersonsBlocs.length)) + '%';
}
},
mounted() {
this.setPersonsInBloc();

View File

@ -1,5 +1,5 @@
<template>
<div class="item-bloc">
<div class="item-bloc" :style="{ 'flex-basis': blocWidth }">
<div class="item-row">
<div class="item-col">
<h4>{{ $t(bloc.title) }}</h4>
@ -25,7 +25,7 @@ export default {
components: {
PersonBadge
},
props: ['bloc', 'setPersonsInBloc'],
props: ['bloc', 'setPersonsInBloc', 'blocWidth'],
methods: {
removePerson(item) {
console.log('@@ CLICK remove person: item', item);

View File

@ -48,9 +48,7 @@ export default {
persons: this.persons.filter(p => p.current_household_id === h)
})
})
console.log(personsByHousehold)
//console.log(personsByHousehold)
return personsByHousehold
},
householdExists(id) {