<template>
  <div class="next-pagination">
    <a-button-group >
      <a-button type="primary"  @click="prevClick">
        <a-icon type="left" />上一页
      </a-button>
      <a-button type="primary" >{{page}}</a-button>
      <a-button type="primary" @click="nextClick">
        下一页<a-icon type="right" />
      </a-button>
    </a-button-group>
  </div>
</template>

<script>
export default {
  name: "nextPagination",
  props:{
    page:String
  },
  model:{
    prop:'page',
    event:'setPage'
  },
  methods:{
    prevClick(){
      if(this.page === 1 ){
        return
      }
      this.page--

      this.$emit('setPage',this.page)
    },
    nextClick(){
      this.page++

      this.$emit('setPage',this.page)
    },
  }
}
</script>

<style scoped>
  .next-pagination{
    text-align: right;
  }
</style>
