diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-06 09:32:20 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-06 09:32:20 +0100 |
commit | 55a30db2e75c416c1139ee938eaea18c70bb0807 (patch) | |
tree | 0563d8d2a08629535c5eb1c007f447827ab58aa4 /src/components/Properties | |
parent | b2f7cf1606b8b8f87dbf430f694e559de5a12ef8 (diff) |
Fix gender select
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components/Properties')
-rw-r--r-- | src/components/Properties/PropertySelect.vue | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/components/Properties/PropertySelect.vue b/src/components/Properties/PropertySelect.vue index 69593f8c..7ea41da1 100644 --- a/src/components/Properties/PropertySelect.vue +++ b/src/components/Properties/PropertySelect.vue @@ -62,7 +62,7 @@ export default { props: { value: { - type: [Object, String], + type: [Object, String, Array], default: '', required: true } @@ -84,13 +84,25 @@ export default { matchedOptions: { get() { let selected = this.propModel.options.find(option => option.id === this.localValue) + // properly display array as a string + if (Array.isArray(this.localValue)) { + return selected || { + id: this.localValue.join(';'), + name: this.localValue.join(';') + } + } return selected || { id: this.localValue, name: this.localValue } }, set(value) { - this.localValue = value.id + // only keeping the array if the original value was one + if (Array.isArray(this.localValue)) { + this.localValue = value.id.split(';') + } else { + this.localValue = value.id + } } } } |