【发布时间】:2020-05-06 05:43:22
【问题描述】:
我需要用 react-admin 构建一个复杂的编辑表单。该表单具有各种使用 react-admin 的 BooleanInput 组件制作的是/否滑块。 如果用户将滑块设置为“是”,则应动态显示更多表单字段,这些字段在主题上引用滑块。如何查询 BooleanInput 组件的状态,或者这个任务会以不同的方式在 react 中解决吗?
<BooleanInput source="yesno" label="show or hide fields" />
<AutocompleteArrayInput source="probably_hidden1" label="show or hide me" choices={[
{ id: 'one', name: '1' },
{ id: 'two', name: '2' },
{ id: 'three', name: '3' }
]} />
<TextInput multiline source="text" label="show or hide me too" />
【问题讨论】:
标签: javascript reactjs jsx react-admin