mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
vue_activity: adapt bloc width, depends of blocs number
This commit is contained in:
parent
92753604fa
commit
b09f32b1c2
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user