Skip to content

Commit

Permalink
Merge pull request #116 from tiancheng-66/main
Browse files Browse the repository at this point in the history
add:单选情况下返回ID 而不是数组
  • Loading branch information
zds-s authored Feb 28, 2024
2 parents 473595e + 3754af4 commit 2cfc6ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/ma-form/formItem/form-user-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const value = ref(get(formModel.value, index))

watch( () => get(formModel.value, index), vl => value.value = vl )
watch( () => value.value, v => {
if(props.component.multiple === false && v.length === 1) {
v = v.shift();
}
set(formModel.value, index, v)
index.indexOf('.') > -1 && delete formModel.value[index]
} )
Expand Down

0 comments on commit 2cfc6ed

Please sign in to comment.