Select.js 542 B

12345678910111213141516171819202122
  1. import React from 'react'
  2. const selectStyle = {
  3. height: '22px',
  4. width: '80px',
  5. fontSize: '14px',
  6. color: 'rgba(0,0,0,.65)',
  7. backgroundColor: '#fff',
  8. border: '1px solid #d9d9d9',
  9. borderRadius: '4px',
  10. marginLeft: '10px',
  11. }
  12. class Select extends React.PureComponent {
  13. render() {
  14. let {style, children, defaultValue, onChange} = this.props
  15. let mergedStyle = {...selectStyle, ...style}
  16. return <select style={mergedStyle} defaultValue={defaultValue} onChange={onChange}>{children}</select>
  17. }
  18. }
  19. export default Select