Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancheng-66 committed Feb 28, 2024
1 parent 75c979e commit 3754af4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/ma-form/formItem/form-user-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ const props = defineProps({
customField: { type: String, default: undefined }
})


const formModel = inject('formModel')
const index = props.customField ?? props.component.dataIndex
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();
v = v.shift();
}
set(formModel.value, index, v)
index.indexOf('.') > -1 && delete formModel.value[index]
Expand Down

0 comments on commit 3754af4

Please sign in to comment.