3
目前我正在试图将其设置为这样的TextField组件的自定义数据属性:材料UI文本字段自定义属性
class TestTextField extends React.Component {
componentDidMount() {console.log(this._input)}
render() {
return (
<TextField
label="Label 1"
InputProps={{placeholder: 'Input 1', 'data-state': 'Data State 1'}}
margin="normal"
inputRef={(elem) => {this._input = elem}}
/>
)
}
}
但是我不能让data-state
与控制台日志说
<textarea rows="1" class="MuiTextarea-textarea-67 MuiInput-input-56 MuiInput-inputMultiline-64" placeholder="Input 1" type="text">
TextField不支持自定义属性吗?我正在使用v1.0.0-beta.6(https://material-ui-1dab0.firebaseapp.com/api/text-field/)
啊,那就是它!谢谢! – platizin