Details.vue 2.0 KB
<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>