diff --git a/src/components/ma-crud/components/searchFormItem/form-select.vue b/src/components/ma-crud/components/searchFormItem/form-select.vue index e2d41d6..5430323 100644 --- a/src/components/ma-crud/components/searchFormItem/form-select.vue +++ b/src/components/ma-crud/components/searchFormItem/form-select.vue @@ -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) diff --git a/src/components/ma-form/formItem/form-select.vue b/src/components/ma-form/formItem/form-select.vue index 55d8089..c7cfe57 100644 --- a/src/components/ma-form/formItem/form-select.vue +++ b/src/components/ma-form/formItem/form-select.vue @@ -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)