远程下拉组件,开启多选后,返回的value值为空 #4883

pull/523/head
zhangdaiscott 2023-05-06 11:31:35 +08:00
parent eb6b2f3d59
commit bcfb19b8bb
2 changed files with 12 additions and 1 deletions

View File

@ -114,6 +114,17 @@
//--@updateBy-begin----author:liusq---date:20210914------for:multiplevalue------
unref(attrs).mode == 'multiple' && !Array.isArray(unref(state)) && setState([]);
//--@updateBy-end----author:liusq---date:20210914------for:multiplevalue------
//update-begin---author:wangshuai ---date:20230505 forvalue------------
initValue();
//update-end---author:wangshuai ---date:20230505 forvalue------------
}
}
function initValue() {
let value = props.value;
if (value && typeof value === 'string' && value != 'null' && value != 'undefined') {
state.value = value.split(',');
}
}

View File

@ -190,7 +190,7 @@
currentValueRef.value = (e as ChangeEvent).target.value;
} else if (component === 'Checkbox') {
currentValueRef.value = (e as ChangeEvent).target.checked;
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
} else if (isString(e) || isBoolean(e) || isNumber(e) || isArray(e)) {
currentValueRef.value = e;
}
const onChange = props.column?.editComponentProps?.onChange;