author.vue 1.54 KB
<template>
  <div class="article-item-header">
    <div class="avatar">
      <WidgetAvatar class="widget-avatar" :src="data.avatar" :width="70" :height="70"></WidgetAvatar>
      <span class="name">{{data.name}}</span>
    </div>
    <div class="opts">
      <button class="btn-follow hover-opacity" v-if="true">关注</button>
      <button class="btn-follow followed hover-opacity" v-else>已关注</button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ArticleAuthor',
  props: {
    data: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  methods: {
  }
};
</script>

<style lang="scss" scoped>
  .article-item-header {
    display: flex;
    border-bottom: 4px solid #f0f0f0;
  }

  .avatar {
    display: flex;
    align-items: center;
    padding: 16px 30px;
    width: 400px;
    height: 100px;
    overflow: hidden;
    background-color: #fff;

    .name {
      font-size: 24px;
      margin-left: 20px;
    }

    .widget-avatar {
      width: 70px;
      height: 70px;
    }
  }

  .opts {
    flex: 1;
    padding-right: 30px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    .btn-follow {
      width: 120px;
      height: 50px;
      padding: 0;
      font-size: 26px;
      border-radius: 3PX;
      background-color: #222;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;

      &.followed {
        border: solid 1px #4a4a4a;
        background-color: #fff;
        color: #000;
      }
    }
  }
</style>