pagination.vue 911 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div id="agination">
  3. <el-pagination
  4. @size-change="handleSizeChange"
  5. @current-change="handleCurrentChange"
  6. :current-page="currentPage"
  7. :page-sizes="pageSizes"
  8. :page-size="pageSize"
  9. layout="total, sizes, prev, pager, next, jumper"
  10. :total="total"
  11. >
  12. </el-pagination>
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. props: ["total", "pageSize", "currentPage"],
  18. data() {
  19. return {
  20. // currentPage: 1, //当前位于页
  21. pageSizes: [10, 20, 50, 100, 200, 500], //每页多少条分组
  22. };
  23. },
  24. methods: {
  25. //切换X条/页触发
  26. handleSizeChange(val) {
  27. this.$emit("handleSizeChange", val);
  28. },
  29. //跳转页触发
  30. handleCurrentChange(val) {
  31. this.$emit("handleCurrentChange", val);
  32. },
  33. },
  34. };
  35. </script>
  36. <style lang="less" scoped>
  37. #agination {
  38. margin-left: 26px;
  39. margin-top: 16px;
  40. }
  41. </style>