【发布时间】:2017-04-15 17:26:14
【问题描述】:
我有一种应用于 ActionSearch 图标的样式,但不幸的是它没有通过。
不知道我可以为这个问题写什么,我认为这很简单,但是当 Paper 获得样式时,图标组件却没有。
知道为什么会这样吗?
import React from 'react';
import Paper from 'material-ui/Paper';
import TextField from 'material-ui/TextField';
import IconButton from 'material-ui/IconButton';
import ActionSearch from 'material-ui/svg-icons/action/search';
const stylePaper = {
width: 400,
margin: '40px auto',
paddingBottom: 10,
textAlign: 'center',
display: 'inline-block'
};
const styleIcon = {
position: 'absolute',
top: 20
};
export default class Home extends React.Component {
constructor(props) {
super(props);
this.state = {value: ''};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({value: event.target.value});
}
handleSubmit(event) {
alert('A name was submitted: ' + this.state.value);
event.preventDefault();
}
render() {
return (
<form onSubmit={this.handleSubmit}>
<Paper zDepth={2} style={stylePaper} >
<TextField
hintText="Type in brand, position or industry"
/>
<IconButton>
<ActionSearch style={styleIcon} />
</IconButton>
</Paper>
</form>
);
}
}
这是检查员图片
【问题讨论】:
标签: reactjs material-ui