Nea*_*arl 24 textfield reactjs material-ui
inputProps和之间有什么区别InputProps?下面的2TextField做同样的事情。我什么时候必须选择其中之一?
<TextField
  label="inputProps"
  inputProps={{
    name: 'inputProps',
    type: 'number',
    placeholder: 'placeholder',
    value,
    onChange: handleChange,
  }}
/>
<TextField
  label="InputProps"
  InputProps={{
    name: 'InputProps',
    type: 'number',
    placeholder: 'placeholder',
    value,
    onChange: handleChange,
  }}
/>
Dmi*_*iif 34
InputProps适用于Input反应组件,因为:
TextField 由较小的组件( FormControl、Input、FilledInput、InputLabel、OutlinedInput 和 FormHelperText )组成,您可以直接利用这些组件来显着自定义表单输入。
inputProps适用于inputDOM 元素并获取其所有属性。
因此,如果有必要更改与inputReact 组件有关的某些内容(例如设置 an Icon),我们应该使用InputProps. 对于不受输入组件属性控制的所有其他更改,有多种输入属性。
| 归档时间: | 
 | 
| 查看次数: | 32057 次 | 
| 最近记录: |