Details.vue
2.0 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<template>
<div class="details">
<router-link to='/xiangQing' class="details1" v-for="item in arr" :key="item.id">
<!-- <div class="details1" v-for="item in arr" :key="item.id" > -->
<div class="details2">
<img :src="item.avatar" alt="" @click="goFangDa">
</div>
<p>{{item.nickname}}</p>
<div class="block">{{item.about_me}}</div>
<!-- {{item.nickname}} -->
<!-- </div> -->
</router-link>
</div>
</template>
<script>
export default {
name: 'Details',
props: {
},
data () {
return {
arr: []
}
},
mounted: function(){
this.getData()
},
created () {
},
methods: {
goFangDa () {
this.$router.push("/fangDa")
},
//获取数据
getData() {
let that = this
this.$axios.post('api/Index/shouye', {
city: ''
}).then(res => {
that.arr = res.data
console.log(res)
}).catch(e => {
console.log(e)
})
}
}
}
</script>
<style scoped lang="scss">
.details{
width:100%;
margin-top:0.6rem;
display: flex;
// flex-direction: column;
flex-wrap:wrap;
min-height:0rem;
overflow-y:scroll;
flex: 1;
.details1{
width:35%;
height:1.4rem;
background:#fff;
border-radius:.25rem;
margin:0.1rem 0.03rem 0.03rem 0.11rem;
padding:5%;
.details2{
width:.4rem;
height:.4rem;
border-radius:.5rem;
// background:red;
float:left;
margin-right:.1rem;
img{
width:100%;
height:100%;
border-radius:.5rem;
float:left;
margin-right:.1rem;
}
}
p{
font-size:.14rem;
line-height:.4rem;
}
.block{
width:1.3rem;
height:1rem;
// background:blue;
font-size:.15rem;
color:#3D444C;
margin-top:.1rem;
}
}
}
</style>