<template>
<div>
  <el-table
    :data="tableData"
    stripe
    style="width: 100%">
    <el-table-column
      prop="newsName"
      label="标题"
     >
    </el-table-column>
    <el-table-column
      prop="createTime"
      label="时间"
      >
    </el-table-column>
    <el-table-column
      prop="createBy"
      label="操作人"
      >
    </el-table-column>
    
    <el-table-column 
      width="180"
     label="操作">
      <template slot-scope="scope">
        <el-button
        type="primary"
          size="mini"
          icon="el-icon-edit-outline"
          @click="handle(scope.$index, scope.row)">编辑</el-button>

      </template>
    </el-table-column>
  </el-table>
  <el-pagination
  	class="pone"
      :page-size='10'
      layout="total, prev, pager, next, jumper"
      :total="totals"
      :current-page.sync="Page"
      @current-change="current_change"
>

    </el-pagination>
    </div>
</template>

<script>
  export default {
    data() {
      return {
          totals:0,
          Page:1,
        tableData: []
      }
    },
    methods:{
        current_change(s){
        var data={
            pageNum:s,
            pageSize:10
        }
        this.$api.getlist.newsList(data).then((res) => {
           this.tableData=res.data.list
        
        }).catch((res) => {
          
        }); 
        }
    },
    created(){
        var data={
            pageNum:1,
            pageSize:10
        }
        this.$api.getlist.newsList(data).then((res) => {
           this.tableData=res.data.list
        
        }).catch((res) => {
          
        }); 
    }
  }
</script>