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-for="bloc in contextPersonsBlocs"
|
||||||
v-bind:key="bloc.key"
|
v-bind:key="bloc.key"
|
||||||
v-bind:bloc="bloc"
|
v-bind:bloc="bloc"
|
||||||
|
v-bind:blocWidth="getBlocWidth"
|
||||||
v-bind:setPersonsInBloc="setPersonsInBloc">
|
v-bind:setPersonsInBloc="setPersonsInBloc">
|
||||||
</persons-bloc>
|
</persons-bloc>
|
||||||
</div>
|
</div>
|
||||||
@ -122,6 +123,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getBlocWidth() {
|
||||||
|
return Math.round(100/(this.contextPersonsBlocs.length)) + '%';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setPersonsInBloc();
|
this.setPersonsInBloc();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="item-bloc">
|
<div class="item-bloc" :style="{ 'flex-basis': blocWidth }">
|
||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
<h4>{{ $t(bloc.title) }}</h4>
|
<h4>{{ $t(bloc.title) }}</h4>
|
||||||
@ -25,7 +25,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
PersonBadge
|
PersonBadge
|
||||||
},
|
},
|
||||||
props: ['bloc', 'setPersonsInBloc'],
|
props: ['bloc', 'setPersonsInBloc', 'blocWidth'],
|
||||||
methods: {
|
methods: {
|
||||||
removePerson(item) {
|
removePerson(item) {
|
||||||
console.log('@@ CLICK remove person: item', item);
|
console.log('@@ CLICK remove person: item', item);
|
||||||
|
@ -48,9 +48,7 @@ export default {
|
|||||||
persons: this.persons.filter(p => p.current_household_id === h)
|
persons: this.persons.filter(p => p.current_household_id === h)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log(personsByHousehold)
|
//console.log(personsByHousehold)
|
||||||
|
|
||||||
|
|
||||||
return personsByHousehold
|
return personsByHousehold
|
||||||
},
|
},
|
||||||
householdExists(id) {
|
householdExists(id) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user