index.vue
811 Bytes
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
<template>
<div>
<div v-for="(item,index) of homelist" :key="item.id" class="box_img">
<img :src="item.imgUrl" alt="" @click="handclick(index)">
<p>{{item.title}}</p>
</div>
</div>
</template>
<script>
import list from '@/assets/json/core.json';
export default {
name: 'master',
components: {},
data(){
return {
homelist: []
}
},
methods: {
handclick(index){
this.$router.push({
path: '/core/detail',
query: {
index: index
}
})
}
},
created() {
this.homelist = list.homecenter.home;
this.$share.initWx('/core')
}
}
</script>
<style lang="" scoped>
img{width:100%;}
p{text-align: center;line-height: .8rem;font-size:.28rem;color:#000;}
</style>