提交 c3206ec5 authored 作者: sin-ning@aliyun.com's avatar sin-ning@aliyun.com

- 优化 DictionarySelect defaultValue 优化

上级 e425d22b
......@@ -4,11 +4,15 @@ import DictionaryContext from './DictionaryContext';
export default class DictionarySelect extends PureComponent {
renderSelect(children) {
// eslint-disable-next-line react/destructuring-assignment
// const { initialValue } = this.props['data-__meta'];
const propsX = this.props;
if (propsX.defaultValue === 'undefined' || propsX.defaultValue === 'null') {
propsX.defaultValue = undefined;
const propsX = {
...this.props,
};
if (propsX.value !== undefined || propsX.value !== null) {
propsX.value = `${propsX.value}`;
}
if (propsX.value === 'undefined' || propsX.value === 'null') {
delete propsX.value;
}
return <Select {...propsX}>{children}</Select>;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论