在<CardMedia>中显示基于URL的图像

时间:2020-02-26 16:28:39

标签: material-ui

因此,我尝试在材料ui卡中显示带有http url的图像,并且该卡可以正确渲染,除非我做任何事情都不会加载图像。这是组件。

  <Card className={styles.root}>
  <CardActionArea>
    <CardMedia image="http://localhost:1337/uploads/47943771232e44028a9d3d5fd18b967e.PNG"/>
    <CardContent>
      <Typography gutterBottom variant="h5" component="h2">
        Lizard
      </Typography>
      <Typography variant="body2" color="textSecondary" component="p">
        Lizards are a widespread group of squamate reptiles, with over 6,000 species, ranging
        across all continents except Antarctica
      </Typography>
    </CardContent>
  </CardActionArea>
  <CardActions>
    <Button size="small" color="primary">
      Share
    </Button>
    <Button size="small" color="primary">
      Learn More
    </Button>
  </CardActions>
</Card>

CardMedia API不支持基于URL的图像吗? 谢谢

0 个答案:

没有答案