<template>
  <div class="item-box">
    <div class="title"><router-link :to="`/news/detail?id=${data.id}&tabs=${index}`">{{ data.title }}</router-link></div>
    <div class="time">{{ data.published_time }}</div>
    <div class="content" v-html="data.excerpt"></div>
    <!-- <router-link :to="`/news/detail?id=${data.id}&tabs=${index}`"><div class="detail-btn">查看详情</div></router-link> -->
  </div>
</template>
<script>
export default {
  props: {
    data: {
      type: Object,
      default: {}
    },
    index: {}
  }
}
</script>
<style lang="scss" scoped>
.item-box{
  border-bottom: 1px solid #eee;
  padding-bottom: 32px;
  padding-top: 24px;
  .title{
    font-size: 18px;
    font-weight: bold;
    color: #C01540;
    line-height: 25px;
  }
  .time{
    font-size: 18px;
    color: #666666;
    line-height: 25px;
    margin: 16px 0;
  }
  .content{
    font-size: 18px;
    color: #666666;
    line-height: 30px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .detail-btn{
    width: 96px;
    height: 36px;
    background: linear-gradient(315deg, rgba(225, 47, 116, 0.83) 0%, #C01540 100%);
    border-radius: 4px;
    font-size: 14px;
    color: #FFFFFF;
    line-height: 36px;
    text-align: center;
    margin-top: 16px;
  }
}
</style>
