indexPageSize.vue 1.11 KB
Newer Older
renjihua committed
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
<template>
  <div class="pageContain">
    <el-pagination
    style="padding:10px;float:right"
      :current-page="pageData.page"
      :page-sizes="pageSize"
      :page-size="pageData.size"
      :total="pageData.total"
      class="admin_pagination"
      layout="total, sizes, prev, pager, next, jumper"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"/>
  </div>
</template>

<script>
export default {
  components: {

  },
  props: {
    pageData: {
      type: Object,
      default: () => {
        return {}
      }
    },
    changePageData: {
      type: Function,
      required: true
    },
    pageSize: {
      type: Array,
      default: () => [5,10, 20, 30, 40]
    }
  },
  data() {
    return {
    }
  },
  computed: {

  },
  watch: {

  },
  created() {

  },
  mounted() {

  },
  methods: {
    handleSizeChange(val) {
      this.changePageData('size', val)
    },
    handleCurrentChange(val) {
      this.changePageData('page', val)
    }
  }
}
</script>

<style scoped lang="scss">
.pageContain{
  // background: red;
  display: flex;
  justify-content: flex-start;
}
</style>