<template>
  <div class="notice-pop-list">
    <ul class="npl-box">
      <li v-for="(item, index) in listData" :key="index">
        <div class="nplb-l">
          {{ item.title }}
        </div>
        <div class="nplb-r">
          {{ item.time }}
        </div>
      </li>
    </ul>
    <el-pagination
      background
      class="smp-pagination"
      layout="prev, pager, next"
      :pager-count="5"
      :page-size="pagingConfig.perPageNum"
      :total="pagingConfig.totalNum"
      @current-change="pagingChange"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    getList: ''
  },
  data () {
    return {
      listData: [],
      pagingConfig: {
        perPageNum: 5,
        totalNum: 1,
        currentPage: 1
      }
    }
  },
  mounted () {
    // this.getData()
  },
  methods: {
    getData () {
      this.getList(this.pagingConfig, this.setData.bind(this))
    },
    pagingChange (num) {
      this.pagingConfig.currentPage += 1
      this.getData()
    },
    setData (d) {
      this.listData = d
      // this.listData
    }
  }
}
</script>

<style lang="scss">
.smp-list-time {
  // padding: 0!important;
}
</style>
