unknown
2023-10-24 c75e9ccac1c92b1f2318c79a8d76c0e3d4da0000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
  <div class="pagination-container">
    <el-pagination @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10, 20, 30]"
      :total="total" :current-page="pageNum" :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"></el-pagination>
  </div>
</template>
<script>
export default {
  name: "pagination",
  data() {
    return {};
  },
  props: {
    // 总页数
    total: {
      type: Number,
    },
    // 当前页
    pageNum: {
      type: Number,
    },
    // 每页显示条数
    pageSize: {
      type: Number,
    },
  },
  methods: {
    // 当前页码变化
    handleCurrentChange(val) {
      this.$emit("change-page-num", val);
    },
    //  每页查看条数变化
    handleSizeChange(val) {
      this.$emit("change-page-size", val);
    },
  },
  // watch: {
  //   pageSize: {
  //     // immediate: true,
  //     handler(newValue, oldValue) {
  //       this.page._pageSize = this.newValue;
  //       console.log("pageSize", newValue, oldValue);
  //     },
  //   },
  //   pageNum: {
  //     // immediate: true,
  //     handler(newValue, oldValue) {
  //       this.page._currentPage = newValue;
  //       console.log("pageNum", newValue, oldValue);
  //     },
  //   },
  // },
};
</script>
<style lang="scss" scoped>
.el-pagination {
  text-align: right;
}
 
// 主体底部样式
::v-deep.el-pagination .btn-prev,
::v-deep.el-pagination .btn-next,
::v-deep.el-pagination .el-pager li {
  background-color: rgba(20, 25, 58, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 400;
  color: #E2E4E9;
  border-radius: 4px;
}
 
::v-deep.el-pagination .el-pager li:not(.disabled).active {
  color: #fff;
  border: 1px solid #39B5FE;
  background-color: #0B3562;
  font-weight: 400;
}
 
.pagination-container {
  margin: 30px 0;
}
</style>