-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathSample_13.vue
52 lines (48 loc) · 1.38 KB
/
Sample_13.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<div class="container">
<div class="row">
<div class="col-md-6">
<h4>Reusability of Components (With Dynamic Data)</h4>
</div>
<div class="col-md-6">
<div class="component-block">
<label>Parent Component : Accordion</label>
<label>Child Component : AccordionItem</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 mt-5">
<h4 class="text-center mb-5"><i class="fa fa-star"></i> Accordion 1 <i class="fa fa-star"></i></h4>
<accordion :items = languages></accordion>
</div>
<div class="col-md-12 mt-5">
<h4 class="text-center mb-5"><i class="fa fa-star"></i> Accordion 2 <i class="fa fa-star"></i></h4>
<accordion :items = contacts></accordion>
</div>
</div>
</div>
</template>
<script>
import Accordion from '../components/Accordion.vue';
export default {
components: { Accordion },
data() {
return {
contacts: [],
languages: []
}
},
created() {
let self = this;
axios.get('/contacts')
.then( function (response) {
self.contacts = response.data;
});
axios.get('/languages')
.then( function (response) {
self.languages = response.data;
});
}
}
</script>