mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
person: add altNames in person form: v-model option but not working
This commit is contained in:
parent
49da5fe060
commit
047083812e
@ -32,7 +32,8 @@
|
||||
</div>
|
||||
|
||||
<div v-for="(a, i) in config.altNames" :key="a.key" class="form-floating mb-3">
|
||||
<input class="form-control form-control-lg" :id="a.key" v-model="altNames[i]" />
|
||||
<!-- <input class="form-control form-control-lg" :id="a.key" @change="enterAltName(value, a)" /> -->
|
||||
<input class="form-control form-control-lg" :id="a.key" v-model="person.altNames[i]" />
|
||||
<label :for="a.key">{{ a.labels.fr }}</label>
|
||||
</div>
|
||||
|
||||
@ -107,29 +108,37 @@ export default {
|
||||
},
|
||||
config: {
|
||||
altNames: []
|
||||
}
|
||||
},
|
||||
dataAltNames: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
firstName: {
|
||||
set(value) { this.person.firstName = value; },
|
||||
set(value) {
|
||||
console.log(value)
|
||||
console.log(this.dataAltNames)
|
||||
this.person.firstName = value;
|
||||
//this.person.altNames = ['CACA'];
|
||||
},
|
||||
get() { return this.person.firstName; }
|
||||
},
|
||||
lastName: {
|
||||
set(value) { this.person.lastName = value; },
|
||||
get() { return this.person.lastName; }
|
||||
},
|
||||
altNames: {
|
||||
set(value) { this.person.altNames.push(
|
||||
{
|
||||
key: 'jeune_fille',
|
||||
label: {
|
||||
fr: value
|
||||
}
|
||||
});
|
||||
},
|
||||
get() { return this.person.altNames; }
|
||||
},
|
||||
// altNames: {
|
||||
// set(value) {
|
||||
// console.log(value)
|
||||
// this.person.altNames=
|
||||
// {
|
||||
// key: value.key, //TODO! // person.altNames is filled by some magic
|
||||
// label: {
|
||||
// fr: value
|
||||
// }
|
||||
// };
|
||||
// },
|
||||
// get() { return this.person.altNames; }
|
||||
// },
|
||||
gender: {
|
||||
set(value) { this.person.gender = value; },
|
||||
get() { return this.person.gender; }
|
||||
@ -158,6 +167,10 @@ export default {
|
||||
set(value) { this.person.email = value; },
|
||||
get() { return this.person.email; }
|
||||
},
|
||||
enterAltName(value, a) {
|
||||
console.log('altname value entered', value)
|
||||
console.log(a)
|
||||
},
|
||||
genderClass() {
|
||||
switch (this.person.gender) {
|
||||
case 'woman':
|
||||
|
Loading…
x
Reference in New Issue
Block a user