element 列表与分页

<div id="table">
      <el-table
        :data="this.dataa.list"
        border
        style=" 100%"
        :header-cell-style="{ background: 'rgba(237, 242, 246, 1)' }"
      >
        <!-- <el-table-column :index="table_index" type="index" label="序号" width="50"></el-table-column> -->

        <el-table-column prop="num" type="index" label="序号" width="50"></el-table-column>
        <el-table-column prop="createTime" label="操作时间" width="200"></el-table-column>
        <el-table-column prop="userName" label="用户名"></el-table-column>
        <!-- <el-table-column prop="action" label="操作模块"></el-table-column> -->
        <el-table-column prop="result" label="操作内容"></el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <div class="pagination">
      <el-pagination
        background
        layout="prev, pager, next"
        :total="dataa.total"
        @current-change="currentpage"
      ></el-pagination>
    </div>
  </div>
 
 
 
 
 
JS部分
 
 
data() {
    return {
      addedittitle: null,
      showedit: false,
      dialogFormVisible: false,
      // 搜索
      search: {
        action: "",
        name: "",
        page: 1,
        size: 10
      },
      // 列表数据
      dataa: {
        pagesize: "",
        list: []
      }
    };
  },
 
methods
 
 getList() {
      this.$http
        .post("rainLog/findList", {
          ...this.search,
          companyId: localStorage.getItem("companyId")
        })
        .then(res => {
          this.dataa = res.data;
          this.dataa.list = res.data.list;
        });
    },
 
 
 
 
 
 
原文地址:https://www.cnblogs.com/shenbo666/p/13215874.html