提交 f1339d6a authored 作者: 肖伟鸣's avatar 肖伟鸣

增加对FormArray自定义组件的支持

上级 e3a315b9
......@@ -78,6 +78,7 @@ const DiyPicker = props => {
value: x.key,
};
});
return (
<Picker
data={opt}
......@@ -233,7 +234,10 @@ class FormArray extends Component {
detailDom = () => {
const { config, formValues, readOnly } = this.props;
return config.map(x => {
return (
config &&
config.length &&
config.map(x => {
x.readOnly = readOnly || x.readOnly;
switch (x.type) {
case 'InputItem':
......@@ -299,10 +303,13 @@ class FormArray extends Component {
changeValue={this.changeValue}
/>
);
case 'Components':
return x.render(formValues[x.key], this.changeValue, x.key);
default:
return null;
}
});
})
);
};
render() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论