2017-08-24 29 views
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/

回答