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

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

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