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

111
Visualizações
Vue Js images are not copied to dist during build process

In a VueJs 3 project I have a list of PNG images. I put the PNG images under src/assets/pngs/. In my Vue componente I build the list with a For loop and put the image name in the img src. In dev mode this works fine.

<div v-for="item in items" :key="item.id">
    <div class="card">
        <p class="hint">{{ item.name }}</p>
        <img :src="makeImgPath(item.img_name)" alt="">
    </div>
</div>
methods: {
  makeImgPath(imgName) {
    return '/src/assets/pngs/' + imgName + '.png';
  }
}

When I build the application with npm run build I get a 404 for all images in the list when built. I have also noticed that the pngs folder and therefore the images are not copied to dist/asstes/. Why is this so and what can I do so that the pictures are copied to the dist folder. Thanks in advance, Max.

almost 4 years ago · Santiago Trujillo
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