-1
我尝试在admin-on-rest上生成动态表单,但我真的不知道如何生成它。 我尝试:使用admin-rest-rest生成动态表单
class MultipleChoice extends Component {
constructor(props) {
super(props);
this.state = { inputs: ['input-0'] };
}
render() {
return(
<div>
<Form>
<div id="dynamicInput">
{this.state.inputs.map(input => <FormInput key={input} />)}
</div>
</Form>
<button onClick={() => this.appendInput() }>
CLICK ME TO ADD AN INPUT
</button>
</div>
);
}
appendInput() {
var newInput = `input-${this.state.inputs.length}`;
this.setState({ inputs: this.state.inputs.concat([newInput]) });
}
}
,但我不能包括上创建的管理上休息 任何建议是值得欢迎的,谢谢
你能先解释一下你的用例吗?你想要达到什么目的? – Gildas