Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

314
Visualizações
how to preview a image in antd 3

Now I am show images in the web ui like this:

{
      title: 'Image',
      render: row => {
        if(row.checkType === 2){
          return (<span style={{color:'red'}}>
                          <img className={styles.img} src={row.url} referrerPolicy="no-referrer" onclick={this.handleOpen(row.url)}alt="img" />
          </span>)
        }else{
          return row.text;
        }
      }
    }

I am using antd 3, it did not contain the Image component. I want that when the user click the image, the image will pop and full the screen so that the user could see the image clear. But the img click have no response by default. I am do it with window.open like this in the onclick event:

handleOpen = (url) =>{
  window.open(url);
}

it seems did not work, when click the image, just pop up the download window. what should I do to make the user preview the image? this is the image url: https://6b02d792-e941-4c15-a344-2e12867d06e1.oss-cn-shanghai.aliyuncs.com/spark/game/images/jigou_64/1646298300722.jpg

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda