reading data from array vue

Solutions on MaxInterview for reading data from array vue by the best coders in the world

showing results for - "reading data from array vue"
Yanis
18 Feb 2017
1//if we have an array of objects like this :
2features: [{
3                    title: 'Create blacklists',
4                    text: 'Ensure .',
5                    src: require("@/assets/images/icon-blacklist.svg"),
6                    imgAlt: 'Create blacklists'
7                },
8                {
9                    title: 'Plain text snippets',
10                    text: 'Remove .',
11                    src: require("@/assets/images/icon-text.svg"),
12                    imgAlt: 'Plain text snippets'
13                },
14                {
15                    title: 'Sneak preview',
16                    text: 'Quick .',
17                    src: require("@/assets/images/icon-preview.svg"),
18                    imgAlt: 'Sneak preview'
19                }
20
21            ]
22            
23//we can display this data with an v-for
24   <b-col xs="12" sm="4" md="4" lg="4" v-for="feat of features" v-bind:key="feat.title">
25            <img :src="feat.src" :alt="feat.imgAlt">
26
27            <h4>{{feat.title}}</h4>
28            <p>{{feat.text}}</p>
29   </b-col>