mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix input value for radio selection in AddPersons modal
selected value is different for radio or checkbox for radio value is an object, for checkbox vaue is an array of objects
This commit is contained in:
parent
e0dc0a8fdb
commit
5b635fbe58
@ -104,7 +104,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addNewPersons({ selected, modal }) {
|
addNewPersons({ selected, modal }) {
|
||||||
console.log('@@@ CLICK button addNewPersons', selected);
|
console.log('@@@ CLICK button addNewPersons', selected);
|
||||||
this.$store.dispatch('addRequestor', selected);
|
this.$store.dispatch('addRequestor', selected.shift());
|
||||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||||
modal.showModal = false;
|
modal.showModal = false;
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
<div class="list-item" :class="{ checked: isChecked }">
|
<div class="list-item" :class="{ checked: isChecked }">
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<input v-model="selected"
|
<input
|
||||||
:type="type"
|
v-bind:type="type"
|
||||||
:value="item" />
|
v-model="selected"
|
||||||
|
name="item"
|
||||||
|
v-bind:id="item"
|
||||||
|
v-bind:value="setValueIfType(item, type)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<suggestion-person
|
<suggestion-person
|
||||||
@ -48,7 +51,12 @@ export default {
|
|||||||
},
|
},
|
||||||
isChecked() {
|
isChecked() {
|
||||||
return (this.search.selected.indexOf(this.item) === -1) ? false : true;
|
return (this.search.selected.indexOf(this.item) === -1) ? false : true;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
setValueIfType(value, type) {
|
||||||
|
return (type === 'radio')? [value] : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user