Skip to content

Commit

Permalink
Merge pull request #215 from People-Sea/fix/#214
Browse files Browse the repository at this point in the history
fix(ma-crud, ma-form): 修复多选 select 反向赋值时非对象类型导致的错误
  • Loading branch information
kanyxmo authored Nov 19, 2024
2 parents 09b82b7 + 1991488 commit d891914
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const handlerFallback = (key) => {
watch( () => get(searchForm.value, props.component.dataIndex), vl => value.value = vl )
watch( () => value.value, v => {
if (props.component.multiple) {
if (!isObject(v)) v = []
v.forEach(k => {
if ( !optionMap.value[k] ) {
optionMap.value[k] = dicts.value[dictIndex].find(i => i.value === k)
Expand Down
1 change: 1 addition & 0 deletions src/components/ma-form/formItem/form-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const keyword = ref('')
watch( () => get(formModel.value, index), vl => value.value = vl )
watch( () => value.value, v => {
if (props.component.multiple) {
if (!isObject(v)) v = []
v.forEach(k => {
if ( !optionMap.value[k] ) {
optionMap.value[k] = dictList.value[dictIndex].find(i => i.value === k)
Expand Down

0 comments on commit d891914

Please sign in to comment.