<template>
  <div class="news">
    <Banner :img="require('@/assets/img/news.png')" />
    <div class="common-container">
      <el-container>
        <LeftTabs title="新闻动态" :options="options" @tabSelect="tabSelect" />
        <NewsRightContent :selectTab="selectTab" :breadList="breadList" />
      </el-container>
    </div>
  </div>
</template>

<script>
import Banner from "../components/Banner";
import LeftTabs from '@/components/LeftTabs'
import NewsRightContent from '@/views/News/RightContent'
export default {
  name: "News",
  components: {
    Banner,
    LeftTabs,
    NewsRightContent
  },
  data() {
    return {
      loading: true,
      selectTab: {},
      options: [
        {
          label: '中心新闻',
          type:'newsInfo',
        },
        {
          label: '通知公告',
          type:'notice',
        }
      ],
      routeList: [
        {
          name: '首页',
          path: '/'
        },
        {
          name: '新闻动态'
        }
      ],
      breadList: []
    };
  },
  methods: {
    // 选择tab
    tabSelect(row) {
      this.selectTab = { ...row }
      this.breadList = [...this.routeList, { name: this.selectTab.label }]
    }
  }
};
</script>

<style lang="scss" scoped>

</style>
