Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
Vue loop through assets directory images

So In my assets directory I have this structure

assets/
 tests/
  @id_story1/
     test1/
           1.png
           2.png

I'm using json-server to fake a rest API and I'm using axios to retrieve information about each tests including the images path (example refpath direct me to the test1 folder)

Now I'm trying to loop through the test assets folder and display the images of the test

Here's my code so far : (this page is dynamically rendered after the user clicks on a dynamic path)

<template>
  <v-app>

    <app-navbar />

    <v-main>
        <h3>test {{$route.params.name}}, {{$route.query.status}},{{$route.query.tag}}</h3>
        <h3>{{items[0].refpath}}</h3>
        

    </v-main>
  </v-app>
</template>

<script>
import appNavbar from '../../../components/appNavbar.vue';
import axios from "axios";
export default {
  components : {appNavbar},
  name: "App",
  data() {
    return {
      items: [],
    };
  },
  async created() {
    try {
      const res = await axios.get(`http://localhost:3004/tests`,{ params: {name:this.$route.params.name} });
      this.items = res.data;
    } catch (error) {
      console.log(error);
    }
  },

};
</script>

<style lang="scss" scoped>

</style>

how can i loop through the images of the assets folder and display them ?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda