import * as React from 'react';
import 'animate.css/animate.css'
import {AutoImg} from "./style";
import {observer} from "mobx-react";
import {action} from "mobx";
import {IAd} from "../../util/type";

interface IIndexProps {
    url: string;
    row:boolean;
    width:number;
    height:number;
}

@observer
class Index extends React.Component<IIndexProps> {

    constructor(props) {
        super(props);
    }

    public render() {
        const {url,row,width,height} = this.props;
        return (
            <div style={{width:`${width}px`,height:`${height}px`,overflow: 'hidden',display:'flex',alignItems:'center',justifyContent:'center'}}>
                {
                    row
                        ?
                        <img src={url} style={{width:'auto',height:'100%'}} alt=""/>
                        :
                        <img src={url} style={{width:'100%',height:'auto'}} alt=""/>
                }
            </div>
        );
    }
}

export default Index;

  

相关文章:

  • 2021-08-23
  • 2022-12-23
  • 2022-01-04
  • 2021-05-24
  • 2022-01-01
猜你喜欢
  • 2021-12-12
  • 2021-05-16
  • 2021-10-13
  • 2022-02-07
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案