<template>
  <div class="page-div">
    <el-pagination
      :page-size="limit"
      :current-page.sync="nowPage"
      layout="total , prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
  export default {
    name: "page",
        data() {
          return {
              nowPage: 1
          }
        },
    props:{
      'total' : {
        required: true
      },
      'limit': {
        default: 10
      }
    },
    watch:{
      nowPage(value){
        this.$emit("pageChange", value);
      }
    }
  }
</script>

<style scoped>
  .page-div{
    display: block;
    text-align: center;
  }
</style>
