简体   繁体   中英

Creating a dynamic gridlist in VUEJs

I have been lately interested in VueJs and looking for a simple way to create a dynamic gridlist in VUEJs for firstName, lastName and images per person.

Here is what i tried and its looks

 <v-subheader>myList</v-subheader>
<v-container fluid grid-list-sm>
    <v-layout row wrap>
        <v-flex v-for="item in customer.images" :key="item.id" xs4>
            <img  :src="item.image"  class="image" alt="lorem" width="50px" height="500px">
        </v-flex>
    </v-layout>
</v-container>


<script>

date()=>({
customer:{
id:"",
firstName:"",
lastName:"",
images:[], <----array od objects {id:"", image:""}
}
});
</script>

try this inside your v-container

<v-layout row wrap v-for="item in customer" :key="item.id">
    <v-layout row wrap>{{item.firstName + ' ' + item.lastName}}</v-layout>
    <v-flex v-for="pic in item.images" :key="pic.id" xs4>
        <img  :src="pic.image"  class="image" alt="lorem" width="50px" height="500px">
    </v-flex>
</v-layout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM