<template>
  <div id="newsList">
    <el-row>
      <el-col :span="24" class="info">
        <el-col :span="24" class="list" @click.native="detailBtn(item.id)" v-for="(item, index) in list" :key="index">
          <span></span>
          <span class="textOver">{{ item.title }}</span>
          <span>{{ item.date }}</span>
        </el-col>
        <el-col :span="24" class="page">
          <pagination :total="total"></pagination>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import pagination from '@/components/pagination.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'newsList',
  props: {
    list: null,
    total: null,
  },
  components: {
    pagination,
  },
  data: function() {
    return {};
  },
  created() {},
  methods: {
    detailBtn(id) {
      this.$emit('detailBtn', id);
    },
  },
  computed: {
    ...mapState(['user']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.info {
  .list {
    padding: 0 0 7px 0;
    span:first-child {
      display: inline-block;
      width: 4px;
      height: 4px;
      background: #ccc;
      margin: 0px 10px 7px 0px;
    }
    span:nth-child(2) {
      display: inline-block;
      font-size: 16px;
      color: #555555;
      font-family: '微软雅黑';
      width: 85%;
      margin: 0 30px 0 0;
    }
    span:last-child {
      display: inline-block;
      width: 90px;
      font-size: 16px;
      color: #a8abb7;
      font-family: '微软雅黑';
      text-align: right;
    }
  }
  .page {
    height: 50px;
  }
}
</style>
