<template>
  <div class="news-detail-box">
    <breadcrumb class="content-max-width crumb" :data="crumbData"/>
    <div class="title">{{ data.title }}</div>
    <div class="content content-max-width" v-html="data.content"></div>
  </div>
</template>
<script>
import action from '@action'
import breadcrumb from '@/components/breadcrumb'
export default {
  components: {
    breadcrumb
  },
  data() {
    return {
      data: {},
      crumbData: [
        {
          path: '/',
          name: '首页'
        },
        {
          path: '/news',
          name: '新闻列表'
        },
        {
          name: '新闻详情'
        }
      ]
    }
  },
  mounted() {
    this.getData()
    if (this.$route.query.type) {
      this.crumbData = [
        {
          path: '/',
          name: '首页'
        },
        {
          name: '新闻详情'
        }
      ]
    }
  },
  methods: {
    getData() {
      action.articleAction.getArticleDetail(this.$route.query.id).then(res => {
        this.data = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.crumb{
  padding-top: 24px;
}
.content-max-width{
  width: 870px;
  margin: 0 auto;
}
.news-detail-box{
  .title{
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #C01540;
    line-height: 25px;
    margin: 24px 0;
  }
  .content{
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    color: #717171;
    line-height: 20px;
    margin-bottom: 24px;
  }
}
</style>
