import * as React from "react"; import {withRouter,RouteComponentProps} from 'react-router-dom' import { Typography, Image } from "antd"; interface PropsType extends RouteComponentProps { id: string | number; size: "large" | "small"; imageSrc: string; price: number | string; title: string; } const ProductImageComponent: React.FC = ({ id, size, imageSrc, price, title, history, location, match }) => { return (
history.push(`detail/${id}`)}> {size === "large" ? ( ) : ( )}
{title.slice(0, 25)} ¥{price}起
); }; export const ProductImage = withRouter(ProductImageComponent)