-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