index.js 851 B

1234567891011121314151617181920212223242526272829
  1. import React,{Component} from 'react';
  2. import './index.less';
  3. class ImgList extends Component{
  4. constructor(props) {
  5. super(props);
  6. this.state={}
  7. }
  8. render() {
  9. return (
  10. <div className='ImgList'>
  11. {
  12. this.props.fileList.map((value,index)=>(
  13. <div key={index} className='fileItem' style={{
  14. width: this.props.width ? this.props.width : '100px',
  15. height: this.props.height ? this.props.height : '100px',
  16. }}>
  17. <img src={value.url} className='imgFile'/>
  18. </div>
  19. ))
  20. }
  21. {console.log(this.props.fileList,'图片')}
  22. </div>
  23. )
  24. }
  25. }
  26. export default ImgList;